From fdad0ecc2399b7278d34936cafb7b47d04598094 Mon Sep 17 00:00:00 2001 From: petschki Date: Tue, 12 Nov 2024 08:55:29 +0100 Subject: [PATCH] [fc] Repository: plone.app.multilingual Branch: refs/heads/7.x Date: 2024-11-12T06:59:59+01:00 Author: 1letter (1letter) <1letter@gmx.de> Commit: https://github.com/plone/plone.app.multilingual/commit/c4ad29b00905bd91d4bfde34f185765d3ecd99a8 Update test setup Files changed: M src/plone/app/multilingual/testing.py Repository: plone.app.multilingual Branch: refs/heads/7.x Date: 2024-11-12T07:00:42+01:00 Author: 1letter (1letter) <1letter@gmx.de> Commit: https://github.com/plone/plone.app.multilingual/commit/33693b4c47fd2245225323d79b0efa46e536ea76 refactoring translate_content robot test Files changed: M src/plone/app/multilingual/tests/robot/test_translate_content.robot Repository: plone.app.multilingual Branch: refs/heads/7.x Date: 2024-11-12T07:01:31+01:00 Author: 1letter (1letter) <1letter@gmx.de> Commit: https://github.com/plone/plone.app.multilingual/commit/fe4fdfec8a4759705fabe373df22a69537def812 refactoring schemaeditor robot test Files changed: M src/plone/app/multilingual/tests/robot/test_schemaeditor.robot Repository: plone.app.multilingual Branch: refs/heads/7.x Date: 2024-11-12T07:20:37+01:00 Author: 1letter (1letter) <1letter@gmx.de> Commit: https://github.com/plone/plone.app.multilingual/commit/61a7bde414d0b0f84688a7fd31312918e1f9a682 refactoring add_translation robot test Files changed: M src/plone/app/multilingual/tests/robot/test_add_translation.robot Repository: plone.app.multilingual Branch: refs/heads/7.x Date: 2024-11-12T07:23:14+01:00 Author: 1letter (1letter) <1letter@gmx.de> Commit: https://github.com/plone/plone.app.multilingual/commit/04d1ab2dae9cf5799c7f5af56af90edfd3098ce2 add news Files changed: A news/475.tests Repository: plone.app.multilingual Branch: refs/heads/7.x Date: 2024-11-12T08:55:29+01:00 Author: Peter Mathis (petschki) Commit: https://github.com/plone/plone.app.multilingual/commit/068f6c280863d8e1de6da2d53c4c93b81b684ca6 Merge pull request #476 from plone/port-robot-tests-plone-6.0.x Port robot tests plone 6.0.x Files changed: A news/475.tests M src/plone/app/multilingual/testing.py M src/plone/app/multilingual/tests/robot/test_add_translation.robot M src/plone/app/multilingual/tests/robot/test_schemaeditor.robot M src/plone/app/multilingual/tests/robot/test_translate_content.robot --- last_commit.txt | 103 +++++++++++++++++++++++++++++++----------------- 1 file changed, 67 insertions(+), 36 deletions(-) diff --git a/last_commit.txt b/last_commit.txt index 5e87a639a6..7f8fe292ef 100644 --- a/last_commit.txt +++ b/last_commit.txt @@ -1,65 +1,96 @@ -Repository: Products.CMFPlone +Repository: plone.app.multilingual -Branch: refs/heads/6.0.x -Date: 2024-11-08T09:03:51+01:00 -Author: Peter Mathis (petschki) -Commit: https://github.com/plone/Products.CMFPlone/commit/578cf035e921be2ab9202a154ee02a5b1087bc1e +Branch: refs/heads/7.x +Date: 2024-11-12T06:59:59+01:00 +Author: 1letter (1letter) <1letter@gmx.de> +Commit: https://github.com/plone/plone.app.multilingual/commit/c4ad29b00905bd91d4bfde34f185765d3ecd99a8 -Fix relative URI resources +Update test setup Files changed: -M Products/CMFPlone/resources/browser/resource.py -M Products/CMFPlone/tests/testResourceRegistries.py +M src/plone/app/multilingual/testing.py -b'diff --git a/Products/CMFPlone/resources/browser/resource.py b/Products/CMFPlone/resources/browser/resource.py\nindex 735a3460d0..6b23027200 100644\n--- a/Products/CMFPlone/resources/browser/resource.py\n+++ b/Products/CMFPlone/resources/browser/resource.py\n@@ -25,6 +25,13 @@\n }\n \n \n+def is_external_url(resource):\n+ # we check if the resource string starts with http and //\n+ # according to relative URI definition in\n+ # https://www.ietf.org/rfc/rfc3986.txt chapter 4.2\n+ return resource.startswith("http") or resource.startswith("//")\n+\n+\n class ResourceBase:\n """Information for script rendering.\n \n@@ -138,7 +145,7 @@ def check_dependencies(bundle_name, depends, bundles):\n depends = check_dependencies(name, record.depends, js_names)\n if depends == "__broken__":\n continue\n- external = record.jscompilation.startswith("http")\n+ external = is_external_url(record.jscompilation)\n PloneScriptResource(\n context=self.context,\n name=name,\n@@ -160,7 +167,7 @@ def check_dependencies(bundle_name, depends, bundles):\n depends = check_dependencies(name, record.depends, css_names)\n if depends == "__broken__":\n continue\n- external = record.csscompilation.startswith("http")\n+ external = is_external_url(record.csscompilation)\n PloneStyleResource(\n context=self.context,\n name=name,\n@@ -187,7 +194,7 @@ def check_dependencies(bundle_name, depends, bundles):\n # add Theme JS\n if themedata["production_js"]:\n # we ignore development_js for external detection\n- external = themedata["production_js"].startswith("http")\n+ external = is_external_url(themedata["production_js"])\n PloneScriptResource(\n context=self.context,\n name="theme",\n@@ -210,7 +217,7 @@ def check_dependencies(bundle_name, depends, bundles):\n # add Theme CSS\n if themedata["production_css"]:\n # we ignore development_css for external detection\n- external = themedata["production_css"].startswith("http")\n+ external = is_external_url(themedata["production_css"])\n PloneStyleResource(\n context=self.context,\n name="theme",\ndiff --git a/Products/CMFPlone/tests/testResourceRegistries.py b/Products/CMFPlone/tests/testResourceRegistries.py\nindex 985532653b..f33fa292bc 100644\n--- a/Products/CMFPlone/tests/testResourceRegistries.py\n+++ b/Products/CMFPlone/tests/testResourceRegistries.py\n@@ -207,6 +207,15 @@ def test_resource_bogus(self):\n resource.file_data, b\'I_do_not_exist\',\n )\n \n+ def test_relative_uri_resource(self):\n+ bundle = self._make_test_bundle()\n+ bundle.jscompilation = "//foo.bar/foobar.js"\n+ view = ScriptsView(self.app, self.app.REQUEST, None, None)\n+ view.update()\n+ results = view.render()\n+ self.assertIn(\'src="//foo.bar/foobar.js"\', results)\n+\n+\n class TestStylesViewlet(PloneTestCase.PloneTestCase):\n def test_styles_viewlet(self):\n styles = StylesView(self.layer["portal"], self.layer["request"], None)\n' +b'diff --git a/src/plone/app/multilingual/testing.py b/src/plone/app/multilingual/testing.py\nindex 9e587dae..aa64c841 100644\n--- a/src/plone/app/multilingual/testing.py\n+++ b/src/plone/app/multilingual/testing.py\n@@ -18,7 +18,8 @@\n from plone.dexterity.utils import iterSchemataForType\n from plone.rfc822 import constructMessageFromSchemata\n from plone.rfc822 import initializeObjectFromSchemata\n-from plone.testing import z2\n+from plone.testing.layer import Layer\n+from plone.testing.zope import WSGI_SERVER_FIXTURE\n from plone.uuid.interfaces import IUUID\n from Products.CMFCore.utils import getToolByName\n from zope.configuration import xmlconfig\n@@ -156,7 +157,7 @@ def setUpPloneSite(self, portal):\n )\n \n \n-class MultipleLanguagesLayer(z2.Layer):\n+class MultipleLanguagesLayer(Layer):\n defaultBases = (PLONE_APP_MULTILINGUAL_PRESET_FIXTURE,)\n \n \n@@ -257,7 +258,11 @@ def create_translation(self, *args, **kwargs):\n )\n \n PLONE_APP_MULTILINGUAL_ROBOT_TESTING = FunctionalTesting(\n- bases=(MULTIPLE_LANGUAGES_LAYER, REMOTE_LIBRARY_BUNDLE_FIXTURE, z2.ZSERVER_FIXTURE),\n+ bases=(\n+ MULTIPLE_LANGUAGES_LAYER,\n+ REMOTE_LIBRARY_BUNDLE_FIXTURE,\n+ WSGI_SERVER_FIXTURE,\n+ ),\n name="plone.app.multilingual:Robot",\n )\n \n' -Repository: Products.CMFPlone +Repository: plone.app.multilingual -Branch: refs/heads/6.0.x -Date: 2024-11-08T09:03:58+01:00 -Author: Peter Mathis (petschki) -Commit: https://github.com/plone/Products.CMFPlone/commit/fdd4a8ade8da60bc017e6132bde2a32b038b3fd2 +Branch: refs/heads/7.x +Date: 2024-11-12T07:00:42+01:00 +Author: 1letter (1letter) <1letter@gmx.de> +Commit: https://github.com/plone/plone.app.multilingual/commit/33693b4c47fd2245225323d79b0efa46e536ea76 -changenote +refactoring translate_content robot test Files changed: -A news/4049.bugfix +M src/plone/app/multilingual/tests/robot/test_translate_content.robot -b'diff --git a/news/4049.bugfix b/news/4049.bugfix\nnew file mode 100644\nindex 0000000000..eeafacf34f\n--- /dev/null\n+++ b/news/4049.bugfix\n@@ -0,0 +1,2 @@\n+Fix resources with relative URI in registry.\n+[petschki]\n' +b'diff --git a/src/plone/app/multilingual/tests/robot/test_translate_content.robot b/src/plone/app/multilingual/tests/robot/test_translate_content.robot\nindex 6c3a9d20..355f1e24 100644\n--- a/src/plone/app/multilingual/tests/robot/test_translate_content.robot\n+++ b/src/plone/app/multilingual/tests/robot/test_translate_content.robot\n@@ -1,16 +1,13 @@\n *** Settings ***\n \n-Resource plone/app/robotframework/keywords.robot\n-Resource plone/app/robotframework/saucelabs.robot\n-Resource plone/app/robotframework/selenium.robot\n+Resource plone/app/robotframework/browser.robot\n \n-Library Remote ${PLONE_URL}/RobotRemote\n+Library Remote ${PLONE_URL}/RobotRemote\n \n-Test Setup Run Keywords Plone test setup\n-Test Teardown Run keywords Plone test teardown\n+Test Setup Run Keywords Plone Test Setup\n+Test Teardown Run keywords Plone Test Teardown\n \n-\n-*** Test Cases ***\n+*** Test cases ***\n \n Scenario: As an editor I can translate a document\n Given a site owner\n@@ -24,7 +21,6 @@ Scenario: As a visitor I can view the translation\n When I switch to Catalan\n Then I can view the document in Catalan\n \n-\n *** Keywords ***\n \n # Given\n@@ -32,48 +28,30 @@ Scenario: As a visitor I can view the translation\n a site owner\n Enable autologin as Manager\n \n-a visitor\n- Disable autologin\n-\n a document in English\n- Create content type=Document\n- ... container=/${PLONE_SITE_ID}/en/\n- ... id=an-english-document\n- ... title=An English Document\n+ Create content type=Document container=/${PLONE_SITE_ID}/en/ id=an-english-document title=An English Document\n \n a document in English with Catalan translation\n- ${uid} = Create content type=Document\n- ... container=/${PLONE_SITE_ID}/en/\n- ... id=an-english-document\n- ... title=An English Document\n- Create translation ${uid} ca\n- ... title=A Catalan Document\n- Go to ${PLONE_URL}/resolveuid/${uid}\n- Wait until page contains An English Document\n+ ${uid}= Create content type=Document container=/${PLONE_SITE_ID}/en/ id=an-english-document title=An English Document\n+ Create translation ${uid} ca title=A Catalan Document\n+ Go to ${PLONE_URL}/resolveuid/${uid}\n+ Get Element //h1[1][text()=\'An English Document\']\n \n # When\n \n I translate the document into Catalan\n- Go to ${PLONE_URL}/en/an-english-document/@@create_translation?language=ca\n- Capture page screenshot\n- Input Text form.widgets.IDublinCore.title A Catalan Document\n- Click Link Dates # workaround for of TinyMCE editor field problem\n- Capture page screenshot\n- Click button css=#form-buttons-save\n-\n- # Wait until page contains Element creat\n- # (Catalan translations not currently available)\n-\n- Wait until page contains A Catalan Document\n+ Go to ${PLONE_URL}/en/an-english-document/@@create_translation?language=ca\n+ Take screenshot\n+ Type Text //input[@name="form.widgets.IDublinCore.title"] A Catalan Document\n+ Take screenshot\n+ Click //button[@id="form-buttons-save"]\n \n I switch to Catalan\n- Click Link xpath=//a[@title=\'Catal\xc3\xa0\']\n- Wait until page contains A Catalan Document\n+ Click //a[@title=\'Catal\xc3\xa0\']\n+ Get Element //h1[1][text()=\'A Catalan Document\']\n \n # Then\n \n I can view the document in Catalan\n- Page Should Contain Element\n- ... xpath=//h1[1][text()=\'A Catalan Document\']\n- Page Should Contain Element\n- ... xpath=//ul[@id=\'portal-languageselector\']/li[contains(@class, \'currentLanguage\')]/a[@title=\'Catal\xc3\xa0\']\n+ Get Element //h1[1][text()=\'A Catalan Document\']\n+ Get Element //ul[@id=\'portal-languageselector\']/li[contains(@class, \'currentLanguage\')]/a[@title=\'Catal\xc3\xa0\']\n' -Repository: Products.CMFPlone +Repository: plone.app.multilingual -Branch: refs/heads/6.0.x -Date: 2024-11-11T10:07:11+01:00 -Author: Peter Mathis (petschki) -Commit: https://github.com/plone/Products.CMFPlone/commit/4b55cfe4b870acda3032dcdc64bd268b0b25ef73 +Branch: refs/heads/7.x +Date: 2024-11-12T07:01:31+01:00 +Author: 1letter (1letter) <1letter@gmx.de> +Commit: https://github.com/plone/plone.app.multilingual/commit/fe4fdfec8a4759705fabe373df22a69537def812 -change external_url check to static class method +refactoring schemaeditor robot test Files changed: -M Products/CMFPlone/resources/browser/resource.py +M src/plone/app/multilingual/tests/robot/test_schemaeditor.robot -b'diff --git a/Products/CMFPlone/resources/browser/resource.py b/Products/CMFPlone/resources/browser/resource.py\nindex 6b23027200..aba363c73d 100644\n--- a/Products/CMFPlone/resources/browser/resource.py\n+++ b/Products/CMFPlone/resources/browser/resource.py\n@@ -25,13 +25,6 @@\n }\n \n \n-def is_external_url(resource):\n- # we check if the resource string starts with http and //\n- # according to relative URI definition in\n- # https://www.ietf.org/rfc/rfc3986.txt chapter 4.2\n- return resource.startswith("http") or resource.startswith("//")\n-\n-\n class ResourceBase:\n """Information for script rendering.\n \n@@ -40,6 +33,13 @@ class ResourceBase:\n initialization.\n """\n \n+ @staticmethod\n+ def is_external_url(resource):\n+ # we check if the resource string starts with http and //\n+ # according to relative URI definition in\n+ # https://www.ietf.org/rfc/rfc3986.txt chapter 4.2\n+ return resource.startswith("http") or resource.startswith("//")\n+\n def _request_bundles(self):\n request = self.request\n request_enabled_bundles = set(getattr(request, "enabled_bundles", []))\n@@ -145,7 +145,7 @@ def check_dependencies(bundle_name, depends, bundles):\n depends = check_dependencies(name, record.depends, js_names)\n if depends == "__broken__":\n continue\n- external = is_external_url(record.jscompilation)\n+ external = self.is_external_url(record.jscompilation)\n PloneScriptResource(\n context=self.context,\n name=name,\n@@ -167,7 +167,7 @@ def check_dependencies(bundle_name, depends, bundles):\n depends = check_dependencies(name, record.depends, css_names)\n if depends == "__broken__":\n continue\n- external = is_external_url(record.csscompilation)\n+ external = self.is_external_url(record.csscompilation)\n PloneStyleResource(\n context=self.context,\n name=name,\n@@ -194,7 +194,7 @@ def check_dependencies(bundle_name, depends, bundles):\n # add Theme JS\n if themedata["production_js"]:\n # we ignore development_js for external detection\n- external = is_external_url(themedata["production_js"])\n+ external = self.is_external_url(themedata["production_js"])\n PloneScriptResource(\n context=self.context,\n name="theme",\n@@ -217,7 +217,7 @@ def check_dependencies(bundle_name, depends, bundles):\n # add Theme CSS\n if themedata["production_css"]:\n # we ignore development_css for external detection\n- external = is_external_url(themedata["production_css"])\n+ external = self.is_external_url(themedata["production_css"])\n PloneStyleResource(\n context=self.context,\n name="theme",\n' +b'diff --git a/src/plone/app/multilingual/tests/robot/test_schemaeditor.robot b/src/plone/app/multilingual/tests/robot/test_schemaeditor.robot\nindex 0ce75781..bda8cfc3 100644\n--- a/src/plone/app/multilingual/tests/robot/test_schemaeditor.robot\n+++ b/src/plone/app/multilingual/tests/robot/test_schemaeditor.robot\n@@ -1,16 +1,13 @@\n *** Settings ***\n \n-Resource plone/app/robotframework/keywords.robot\n-Resource plone/app/robotframework/saucelabs.robot\n-Resource plone/app/robotframework/selenium.robot\n+Resource plone/app/robotframework/browser.robot\n \n-Library Remote ${PLONE_URL}/RobotRemote\n+Library Remote ${PLONE_URL}/RobotRemote\n \n-Test Setup Run Keywords Plone test setup\n-Test Teardown Run keywords Plone test teardown\n+Test Setup Run Keywords Plone test setup\n+Test Teardown Run keywords Plone test teardown\n \n-\n-*** Test Cases ***\n+*** Test cases ***\n \n Scenario: As a site owner I can see language independent field setting\n Given a site owner\n@@ -42,54 +39,54 @@ Scenario: As a site owner I can unset field from being language independent\n # Given\n \n a site owner\n- Enable autologin as Manager\n+ Enable autologin as Manager\n \n a dexterity content type with a TTW field\n- Create content type Custom\n- Go to ${PLONE_URL}/dexterity-types/Custom/@@fields\n- Wait until page contains element css=body.template-fields\n+ Create content type Custom\n+ Go to ${PLONE_URL}/dexterity-types/Custom/@@fields\n+ Get Element //body[contains(@class, "template-fields")]\n \n a dexterity content type field settings form\n- Go to ${PLONE_URL}/dexterity-types/Custom/@@fields\n- Go to ${PLONE_URL}/dexterity-types/Custom/custom\n- Wait until page contains Language independent field\n+ Go to ${PLONE_URL}/dexterity-types/Custom/@@fields\n+ Go to ${PLONE_URL}/dexterity-types/Custom/custom\n+ Get Text //div[@id="form-widgets-IFieldLanguageIndependent-languageindependent"] contains Language independent field\n \n a dexterity content type with a language independent TTW field\n- Create content type Custom\n- Set field language independent Custom custom on\n- Go to ${PLONE_URL}/dexterity-types/Custom/@@fields\n- Wait until page contains element css=body.template-fields\n+ Create content type Custom\n+ Set field language independent Custom custom on\n+ Go to ${PLONE_URL}/dexterity-types/Custom/@@fields\n+ Get Element //body[contains(@class, "template-fields")]\n \n # When\n \n I open the field settings\n- Go to ${PLONE_URL}/dexterity-types/Custom/custom\n- Page should contain Language independent field\n+ Go to ${PLONE_URL}/dexterity-types/Custom/custom\n+ Get Text //div[@id="form-widgets-IFieldLanguageIndependent-languageindependent"] contains Language independent field\n \n I select the language independent field setting\n- Select checkbox form-widgets-IFieldLanguageIndependent-languageindependent-0\n- Checkbox should be selected form-widgets-IFieldLanguageIndependent-languageindependent-0\n+ Check Checkbox //input[@id="form-widgets-IFieldLanguageIndependent-languageindependent-0"]\n+ Get Checkbox State //input[@id="form-widgets-IFieldLanguageIndependent-languageindependent-0"] == checked\n \n I save the form\n- Wait until page contains element css=#form-buttons-save\n- Click button css=#form-buttons-save\n- Wait until keyword succeeds 1 10 Element should not be visible .plone-modal-wrapper\n+ Get Element //*[@id="form-buttons-save"]\n+ Click //*[@id="form-buttons-save"]\n+ Get Element Count //div[contains(@class,"plone-modal-wrapper")] should be 0\n \n I open the form again\n- Go to ${PLONE_URL}/dexterity-types/Custom/custom\n- Wait until page contains Language independent field\n+ Go to ${PLONE_URL}/dexterity-types/Custom/custom\n+ Get Text //div[@id="form-widgets-IFieldLanguageIndependent-languageindependent"] contains Language independent field\n \n I unselect the language independent field setting\n- Unselect checkbox form-widgets-IFieldLanguageIndependent-languageindependent-0\n- Checkbox should not be selected form-widgets-IFieldLanguageIndependent-languageindependent-0\n+ Uncheck Checkbox //input[@id="form-widgets-IFieldLanguageIndependent-languageindependent-0"]\n+ Get Checkbox State //input[@id="form-widgets-IFieldLanguageIndependent-languageindependent-0"] == unchecked\n \n # Then\n \n I can see the language independent field setting\n- Wait until page contains element id=form-widgets-IFieldLanguageIndependent-languageindependent-0\n+ Get Element //*[@id="form-widgets-IFieldLanguageIndependent-languageindependent-0"]\n \n the language independent field setting is selected\n- Checkbox should be selected form-widgets-IFieldLanguageIndependent-languageindependent-0\n+ Get Checkbox State //input[@id="form-widgets-IFieldLanguageIndependent-languageindependent-0"] == checked\n \n the language independent field setting is not selected\n- Checkbox should not be selected form-widgets-IFieldLanguageIndependent-languageindependent-0\n+ Get Checkbox State //input[@id="form-widgets-IFieldLanguageIndependent-languageindependent-0"] == unchecked\n' -Repository: Products.CMFPlone +Repository: plone.app.multilingual -Branch: refs/heads/6.0.x -Date: 2024-11-11T18:34:56+01:00 -Author: Jens W. Klein (jensens) -Commit: https://github.com/plone/Products.CMFPlone/commit/678e0acf5466abd2374bb381133aad47d3fcf7ca +Branch: refs/heads/7.x +Date: 2024-11-12T07:20:37+01:00 +Author: 1letter (1letter) <1letter@gmx.de> +Commit: https://github.com/plone/plone.app.multilingual/commit/61a7bde414d0b0f84688a7fd31312918e1f9a682 -Merge pull request #4051 from plone/issue-4049-plone-6.0 +refactoring add_translation robot test -Fix relative URI resources [6.0] +Files changed: +M src/plone/app/multilingual/tests/robot/test_add_translation.robot + +b'diff --git a/src/plone/app/multilingual/tests/robot/test_add_translation.robot b/src/plone/app/multilingual/tests/robot/test_add_translation.robot\nindex 46a5b9ac..6a990b85 100644\n--- a/src/plone/app/multilingual/tests/robot/test_add_translation.robot\n+++ b/src/plone/app/multilingual/tests/robot/test_add_translation.robot\n@@ -1,14 +1,11 @@\n *** Settings ***\n \n-Resource plone/app/robotframework/keywords.robot\n-Resource plone/app/robotframework/saucelabs.robot\n-Resource plone/app/robotframework/selenium.robot\n-Resource Products/CMFPlone/tests/robot/keywords.robot\n+Resource plone/app/robotframework/browser.robot\n \n-Library Remote ${PLONE_URL}/RobotRemote\n+Library Remote ${PLONE_URL}/RobotRemote\n \n-Test Setup Run Keywords Plone test setup\n-Test Teardown Run keywords Plone test teardown\n+Test Setup Run Keywords Plone test setup\n+Test Teardown Run keywords Plone test teardown\n \n *** Test Cases ***\n \n@@ -24,74 +21,57 @@ Scenario: As an editor I can add new translation\n \n *** Keywords ***\n \n-Setup test browser\n- Set Selenium speed 0.5s\n- Open test browser\n- Set window size 1200 900\n-\n # Given\n \n a site owner\n- Enable autologin as Manager\n+ Enable autologin as Manager\n \n a document in English\n- Create content type=Document\n- ... container=/${PLONE_SITE_ID}/en/\n- ... id=an-english-document\n- ... title=An English Document\n+ Create content type=Document container=/${PLONE_SITE_ID}/en/ id=an-english-document title=An English Document\n \n a document in Catalan\n- Create content type=Document\n- ... container=/${PLONE_SITE_ID}/ca/\n- ... id=a-catalan-document\n- ... title=A Catalan Document\n+ Create content type=Document container=/${PLONE_SITE_ID}/ca/ id=a-catalan-document title=A Catalan Document\n \n # When\n \n I view the Catalan document\n- Go to ${PLONE_URL}/ca/a-catalan-document\n- Wait until page contains A Catalan Document\n+ Go to ${PLONE_URL}/ca/a-catalan-document\n+ Get Element //h1[1][text()=\'A Catalan Document\']\n \n I link the document in English as a translation\n- Page should contain element css=#plone-contentmenu-multilingual a\n- Capture page screenshot\n- Element should be visible css=#plone-contentmenu-multilingual a\n- Click Element css=#plone-contentmenu-multilingual a\n- Wait until page contains element css=#_modify_translations\n- Wait until element is visible css=#_modify_translations\n-\n- Click Element css=#_modify_translations\n- Given patterns are loaded\n- Wait until page contains element css=#translations-overview .connectTranslationAction\n-\n- Click Element css=#translations-overview .connectTranslationAction\n- Wait until page contains element css=.select2-choices\n- Wait until element is visible css=.select2-choices\n- Click Element css=#formfield-form-widgets-content .pat-relateditems-container button.mode.search\n- Input Text css=#formfield-form-widgets-content .select2-input en\n- Wait until page contains element xpath=(//span[contains(., \'An English Document\')])\n- Wait until element is visible xpath=(//span[contains(., \'An English Document\')])\n- Click Element xpath=(//span[contains(., \'An English Document\')])\n- Wait until page contains An English Document\n-\n- # We need a complicated xpath, because for some reason a button with this id is there twice.\n- # The first one is hidden.\n- Click Element xpath=(//*[contains(@class, \'modal-footer\')]//button[@id=\'form-buttons-connect_translation\'])\n- Wait until page contains element xpath=(//h3[@class="translationTitle"])\n- Sleep 5\n- Wait until element is visible xpath=(//h3[@class="translationTitle"])\n- Set Focus To Element xpath=(//*[@id="translations-overview"]//a[contains(@href,"a-catalan-document")])\n- Click Element xpath=(//*[@id="translations-overview"]//a[contains(text(),\'/plone/ca/a-catalan-document\')])\n- Wait until page contains A Catalan Document\n+ Get Element //li[@id="plone-contentmenu-multilingual"]/a\n+ Take Screenshot\n+ Get Element States //li[@id="plone-contentmenu-multilingual"]/a contains visible\n+ Click //li[@id="plone-contentmenu-multilingual"]/a\n+ Get Element States //a[@id="_modify_translations"] contains visible\n+ Click //a[@id="_modify_translations"]\n+ Click //table[@id="translations-overview"]/tbody/tr[1]/td[3]/a[contains(@class,"connectTranslationAction")]\n+ Click //form[@id="form"]//div[@id="formfield-form-widgets-content"]//button[contains(@class,"mode") and contains(@class,"browse")]\n+ Wait For Condition Element States //ul[@class="select2-results"] contains visible\n+ Click //ul[@class="select2-results"]/li/div/div/div/a[@data-path="/en" and contains(@class,"pat-relateditems-result-browse")]\n+ Click //a[@data-path="/en/an-english-document"]\n+ Click //*[contains(@class, \'modal-footer\')]//button[@name=\'form.buttons.connect_translation\']\n+ Get Text //table[@id="translations-overview"]/tbody/tr[1]/td[2]/h3[@class="translationTitle"] should be An English Document\n+ Click //table[@id="translations-overview"]//a[contains(text(),\'/plone/ca/a-catalan-document\')]\n+ Get Text //*[@id="content"]/header/h1 should be A Catalan Document\n \n I switch to English\n- Click Link xpath=//a[@title=\'English\']\n- Wait until page contains An English Document\n+ Click //a[@title=\'English\']\n+ Get Element //h1[1][contains(text(),\'An English Document\')]\n \n # Then\n \n I can view the document in English\n- Wait until page contains element\n- ... xpath=//h1[1][contains(text(),\'English Document\')]\n- Wait until page contains element\n- ... xpath=//ul[@id=\'portal-languageselector\']/li[contains(@class, \'currentLanguage\')]/a[@title=\'English\']\n+ Get Element //h1[1][contains(text(),\'English Document\')]\n+ Get Element //ul[@id=\'portal-languageselector\']/li[contains(@class, \'currentLanguage\')]/a[@title=\'English\']\n+\n+\n+# DRY\n+\n+Click item in column\n+ [arguments] ${colnumber} ${itemposition}\n+ Click //div[contains(@class, "content-browser-wrapper")]//div[contains(@class, "levelColumns")]/div[${colnumber}]/div[contains(@class, "levelItems")]/div[${itemposition}]\n+\n+Pause\n+ Import library Dialogs\n+ Pause execution\n' + +Repository: plone.app.multilingual + + +Branch: refs/heads/7.x +Date: 2024-11-12T07:23:14+01:00 +Author: 1letter (1letter) <1letter@gmx.de> +Commit: https://github.com/plone/plone.app.multilingual/commit/04d1ab2dae9cf5799c7f5af56af90edfd3098ce2 + +add news + +Files changed: +A news/475.tests + +b'diff --git a/news/475.tests b/news/475.tests\nnew file mode 100644\nindex 000000000..05c754bc0\n--- /dev/null\n+++ b/news/475.tests\n@@ -0,0 +1 @@\n+Port robot tests to playwright based test, us browser library [@1letter]\n' + +Repository: plone.app.multilingual + + +Branch: refs/heads/7.x +Date: 2024-11-12T08:55:29+01:00 +Author: Peter Mathis (petschki) +Commit: https://github.com/plone/plone.app.multilingual/commit/068f6c280863d8e1de6da2d53c4c93b81b684ca6 + +Merge pull request #476 from plone/port-robot-tests-plone-6.0.x + +Port robot tests plone 6.0.x Files changed: -A news/4049.bugfix -M Products/CMFPlone/resources/browser/resource.py -M Products/CMFPlone/tests/testResourceRegistries.py +A news/475.tests +M src/plone/app/multilingual/testing.py +M src/plone/app/multilingual/tests/robot/test_add_translation.robot +M src/plone/app/multilingual/tests/robot/test_schemaeditor.robot +M src/plone/app/multilingual/tests/robot/test_translate_content.robot -b'diff --git a/Products/CMFPlone/resources/browser/resource.py b/Products/CMFPlone/resources/browser/resource.py\nindex 735a3460d0..aba363c73d 100644\n--- a/Products/CMFPlone/resources/browser/resource.py\n+++ b/Products/CMFPlone/resources/browser/resource.py\n@@ -33,6 +33,13 @@ class ResourceBase:\n initialization.\n """\n \n+ @staticmethod\n+ def is_external_url(resource):\n+ # we check if the resource string starts with http and //\n+ # according to relative URI definition in\n+ # https://www.ietf.org/rfc/rfc3986.txt chapter 4.2\n+ return resource.startswith("http") or resource.startswith("//")\n+\n def _request_bundles(self):\n request = self.request\n request_enabled_bundles = set(getattr(request, "enabled_bundles", []))\n@@ -138,7 +145,7 @@ def check_dependencies(bundle_name, depends, bundles):\n depends = check_dependencies(name, record.depends, js_names)\n if depends == "__broken__":\n continue\n- external = record.jscompilation.startswith("http")\n+ external = self.is_external_url(record.jscompilation)\n PloneScriptResource(\n context=self.context,\n name=name,\n@@ -160,7 +167,7 @@ def check_dependencies(bundle_name, depends, bundles):\n depends = check_dependencies(name, record.depends, css_names)\n if depends == "__broken__":\n continue\n- external = record.csscompilation.startswith("http")\n+ external = self.is_external_url(record.csscompilation)\n PloneStyleResource(\n context=self.context,\n name=name,\n@@ -187,7 +194,7 @@ def check_dependencies(bundle_name, depends, bundles):\n # add Theme JS\n if themedata["production_js"]:\n # we ignore development_js for external detection\n- external = themedata["production_js"].startswith("http")\n+ external = self.is_external_url(themedata["production_js"])\n PloneScriptResource(\n context=self.context,\n name="theme",\n@@ -210,7 +217,7 @@ def check_dependencies(bundle_name, depends, bundles):\n # add Theme CSS\n if themedata["production_css"]:\n # we ignore development_css for external detection\n- external = themedata["production_css"].startswith("http")\n+ external = self.is_external_url(themedata["production_css"])\n PloneStyleResource(\n context=self.context,\n name="theme",\ndiff --git a/Products/CMFPlone/tests/testResourceRegistries.py b/Products/CMFPlone/tests/testResourceRegistries.py\nindex 985532653b..f33fa292bc 100644\n--- a/Products/CMFPlone/tests/testResourceRegistries.py\n+++ b/Products/CMFPlone/tests/testResourceRegistries.py\n@@ -207,6 +207,15 @@ def test_resource_bogus(self):\n resource.file_data, b\'I_do_not_exist\',\n )\n \n+ def test_relative_uri_resource(self):\n+ bundle = self._make_test_bundle()\n+ bundle.jscompilation = "//foo.bar/foobar.js"\n+ view = ScriptsView(self.app, self.app.REQUEST, None, None)\n+ view.update()\n+ results = view.render()\n+ self.assertIn(\'src="//foo.bar/foobar.js"\', results)\n+\n+\n class TestStylesViewlet(PloneTestCase.PloneTestCase):\n def test_styles_viewlet(self):\n styles = StylesView(self.layer["portal"], self.layer["request"], None)\ndiff --git a/news/4049.bugfix b/news/4049.bugfix\nnew file mode 100644\nindex 0000000000..eeafacf34f\n--- /dev/null\n+++ b/news/4049.bugfix\n@@ -0,0 +1,2 @@\n+Fix resources with relative URI in registry.\n+[petschki]\n' +b'diff --git a/news/475.tests b/news/475.tests\nnew file mode 100644\nindex 000000000..05c754bc0\n--- /dev/null\n+++ b/news/475.tests\n@@ -0,0 +1 @@\n+Port robot tests to playwright based test, us browser library [@1letter]\ndiff --git a/src/plone/app/multilingual/testing.py b/src/plone/app/multilingual/testing.py\nindex 9e587dae3..aa64c8413 100644\n--- a/src/plone/app/multilingual/testing.py\n+++ b/src/plone/app/multilingual/testing.py\n@@ -18,7 +18,8 @@\n from plone.dexterity.utils import iterSchemataForType\n from plone.rfc822 import constructMessageFromSchemata\n from plone.rfc822 import initializeObjectFromSchemata\n-from plone.testing import z2\n+from plone.testing.layer import Layer\n+from plone.testing.zope import WSGI_SERVER_FIXTURE\n from plone.uuid.interfaces import IUUID\n from Products.CMFCore.utils import getToolByName\n from zope.configuration import xmlconfig\n@@ -156,7 +157,7 @@ def setUpPloneSite(self, portal):\n )\n \n \n-class MultipleLanguagesLayer(z2.Layer):\n+class MultipleLanguagesLayer(Layer):\n defaultBases = (PLONE_APP_MULTILINGUAL_PRESET_FIXTURE,)\n \n \n@@ -257,7 +258,11 @@ def create_translation(self, *args, **kwargs):\n )\n \n PLONE_APP_MULTILINGUAL_ROBOT_TESTING = FunctionalTesting(\n- bases=(MULTIPLE_LANGUAGES_LAYER, REMOTE_LIBRARY_BUNDLE_FIXTURE, z2.ZSERVER_FIXTURE),\n+ bases=(\n+ MULTIPLE_LANGUAGES_LAYER,\n+ REMOTE_LIBRARY_BUNDLE_FIXTURE,\n+ WSGI_SERVER_FIXTURE,\n+ ),\n name="plone.app.multilingual:Robot",\n )\n \ndiff --git a/src/plone/app/multilingual/tests/robot/test_add_translation.robot b/src/plone/app/multilingual/tests/robot/test_add_translation.robot\nindex 46a5b9ac6..6a990b852 100644\n--- a/src/plone/app/multilingual/tests/robot/test_add_translation.robot\n+++ b/src/plone/app/multilingual/tests/robot/test_add_translation.robot\n@@ -1,14 +1,11 @@\n *** Settings ***\n \n-Resource plone/app/robotframework/keywords.robot\n-Resource plone/app/robotframework/saucelabs.robot\n-Resource plone/app/robotframework/selenium.robot\n-Resource Products/CMFPlone/tests/robot/keywords.robot\n+Resource plone/app/robotframework/browser.robot\n \n-Library Remote ${PLONE_URL}/RobotRemote\n+Library Remote ${PLONE_URL}/RobotRemote\n \n-Test Setup Run Keywords Plone test setup\n-Test Teardown Run keywords Plone test teardown\n+Test Setup Run Keywords Plone test setup\n+Test Teardown Run keywords Plone test teardown\n \n *** Test Cases ***\n \n@@ -24,74 +21,57 @@ Scenario: As an editor I can add new translation\n \n *** Keywords ***\n \n-Setup test browser\n- Set Selenium speed 0.5s\n- Open test browser\n- Set window size 1200 900\n-\n # Given\n \n a site owner\n- Enable autologin as Manager\n+ Enable autologin as Manager\n \n a document in English\n- Create content type=Document\n- ... container=/${PLONE_SITE_ID}/en/\n- ... id=an-english-document\n- ... title=An English Document\n+ Create content type=Document container=/${PLONE_SITE_ID}/en/ id=an-english-document title=An English Document\n \n a document in Catalan\n- Create content type=Document\n- ... container=/${PLONE_SITE_ID}/ca/\n- ... id=a-catalan-document\n- ... title=A Catalan Document\n+ Create content type=Document container=/${PLONE_SITE_ID}/ca/ id=a-catalan-document title=A Catalan Document\n \n # When\n \n I view the Catalan document\n- Go to ${PLONE_URL}/ca/a-catalan-document\n- Wait until page contains A Catalan Document\n+ Go to ${PLONE_URL}/ca/a-catalan-document\n+ Get Element //h1[1][text()=\'A Catalan Document\']\n \n I link the document in English as a translation\n- Page should contain element css=#plone-contentmenu-multilingual a\n- Capture page screenshot\n- Element should be visible css=#plone-contentmenu-multilingual a\n- Click Element css=#plone-contentmenu-multilingual a\n- Wait until page contains element css=#_modify_translations\n- Wait until element is visible css=#_modify_translations\n-\n- Click Element css=#_modify_translations\n- Given patterns are loaded\n- Wait until page contains element css=#translations-overview .connectTranslationAction\n-\n- Click Element css=#translations-overview .connectTranslationAction\n- Wait until page contains element css=.select2-choices\n- Wait until element is visible css=.select2-choices\n- Click Element css=#formfield-form-widgets-content .pat-relateditems-container button.mode.search\n- Input Text css=#formfield-form-widgets-content .select2-input en\n- Wait until page contains element xpath=(//span[contains(., \'An English Document\')])\n- Wait until element is visible xpath=(//span[contains(., \'An English Document\')])\n- Click Element xpath=(//span[contains(., \'An English Document\')])\n- Wait until page contains An English Document\n-\n- # We need a complicated xpath, because for some reason a button with this id is there twice.\n- # The first one is hidden.\n- Click Element xpath=(//*[contains(@class, \'modal-footer\')]//button[@id=\'form-buttons-connect_translation\'])\n- Wait until page contains element xpath=(//h3[@class="translationTitle"])\n- Sleep 5\n- Wait until element is visible xpath=(//h3[@class="translationTitle"])\n- Set Focus To Element xpath=(//*[@id="translations-overview"]//a[contains(@href,"a-catalan-document")])\n- Click Element xpath=(//*[@id="translations-overview"]//a[contains(text(),\'/plone/ca/a-catalan-document\')])\n- Wait until page contains A Catalan Document\n+ Get Element //li[@id="plone-contentmenu-multilingual"]/a\n+ Take Screenshot\n+ Get Element States //li[@id="plone-contentmenu-multilingual"]/a contains visible\n+ Click //li[@id="plone-contentmenu-multilingual"]/a\n+ Get Element States //a[@id="_modify_translations"] contains visible\n+ Click //a[@id="_modify_translations"]\n+ Click //table[@id="translations-overview"]/tbody/tr[1]/td[3]/a[contains(@class,"connectTranslationAction")]\n+ Click //form[@id="form"]//div[@id="formfield-form-widgets-content"]//button[contains(@class,"mode") and contains(@class,"browse")]\n+ Wait For Condition Element States //ul[@class="select2-results"] contains visible\n+ Click //ul[@class="select2-results"]/li/div/div/div/a[@data-path="/en" and contains(@class,"pat-relateditems-result-browse")]\n+ Click //a[@data-path="/en/an-english-document"]\n+ Click //*[contains(@class, \'modal-footer\')]//button[@name=\'form.buttons.connect_translation\']\n+ Get Text //table[@id="translations-overview"]/tbody/tr[1]/td[2]/h3[@class="translationTitle"] should be An English Document\n+ Click //table[@id="translations-overview"]//a[contains(text(),\'/plone/ca/a-catalan-document\')]\n+ Get Text //*[@id="content"]/header/h1 should be A Catalan Document\n \n I switch to English\n- Click Link xpath=//a[@title=\'English\']\n- Wait until page contains An English Document\n+ Click //a[@title=\'English\']\n+ Get Element //h1[1][contains(text(),\'An English Document\')]\n \n # Then\n \n I can view the document in English\n- Wait until page contains element\n- ... xpath=//h1[1][contains(text(),\'English Document\')]\n- Wait until page contains element\n- ... xpath=//ul[@id=\'portal-languageselector\']/li[contains(@class, \'currentLanguage\')]/a[@title=\'English\']\n+ Get Element //h1[1][contains(text(),\'English Document\')]\n+ Get Element //ul[@id=\'portal-languageselector\']/li[contains(@class, \'currentLanguage\')]/a[@title=\'English\']\n+\n+\n+# DRY\n+\n+Click item in column\n+ [arguments] ${colnumber} ${itemposition}\n+ Click //div[contains(@class, "content-browser-wrapper")]//div[contains(@class, "levelColumns")]/div[${colnumber}]/div[contains(@class, "levelItems")]/div[${itemposition}]\n+\n+Pause\n+ Import library Dialogs\n+ Pause execution\ndiff --git a/src/plone/app/multilingual/tests/robot/test_schemaeditor.robot b/src/plone/app/multilingual/tests/robot/test_schemaeditor.robot\nindex 0ce75781c..bda8cfc3c 100644\n--- a/src/plone/app/multilingual/tests/robot/test_schemaeditor.robot\n+++ b/src/plone/app/multilingual/tests/robot/test_schemaeditor.robot\n@@ -1,16 +1,13 @@\n *** Settings ***\n \n-Resource plone/app/robotframework/keywords.robot\n-Resource plone/app/robotframework/saucelabs.robot\n-Resource plone/app/robotframework/selenium.robot\n+Resource plone/app/robotframework/browser.robot\n \n-Library Remote ${PLONE_URL}/RobotRemote\n+Library Remote ${PLONE_URL}/RobotRemote\n \n-Test Setup Run Keywords Plone test setup\n-Test Teardown Run keywords Plone test teardown\n+Test Setup Run Keywords Plone test setup\n+Test Teardown Run keywords Plone test teardown\n \n-\n-*** Test Cases ***\n+*** Test cases ***\n \n Scenario: As a site owner I can see language independent field setting\n Given a site owner\n@@ -42,54 +39,54 @@ Scenario: As a site owner I can unset field from being language independent\n # Given\n \n a site owner\n- Enable autologin as Manager\n+ Enable autologin as Manager\n \n a dexterity content type with a TTW field\n- Create content type Custom\n- Go to ${PLONE_URL}/dexterity-types/Custom/@@fields\n- Wait until page contains element css=body.template-fields\n+ Create content type Custom\n+ Go to ${PLONE_URL}/dexterity-types/Custom/@@fields\n+ Get Element //body[contains(@class, "template-fields")]\n \n a dexterity content type field settings form\n- Go to ${PLONE_URL}/dexterity-types/Custom/@@fields\n- Go to ${PLONE_URL}/dexterity-types/Custom/custom\n- Wait until page contains Language independent field\n+ Go to ${PLONE_URL}/dexterity-types/Custom/@@fields\n+ Go to ${PLONE_URL}/dexterity-types/Custom/custom\n+ Get Text //div[@id="form-widgets-IFieldLanguageIndependent-languageindependent"] contains Language independent field\n \n a dexterity content type with a language independent TTW field\n- Create content type Custom\n- Set field language independent Custom custom on\n- Go to ${PLONE_URL}/dexterity-types/Custom/@@fields\n- Wait until page contains element css=body.template-fields\n+ Create content type Custom\n+ Set field language independent Custom custom on\n+ Go to ${PLONE_URL}/dexterity-types/Custom/@@fields\n+ Get Element //body[contains(@class, "template-fields")]\n \n # When\n \n I open the field settings\n- Go to ${PLONE_URL}/dexterity-types/Custom/custom\n- Page should contain Language independent field\n+ Go to ${PLONE_URL}/dexterity-types/Custom/custom\n+ Get Text //div[@id="form-widgets-IFieldLanguageIndependent-languageindependent"] contains Language independent field\n \n I select the language independent field setting\n- Select checkbox form-widgets-IFieldLanguageIndependent-languageindependent-0\n- Checkbox should be selected form-widgets-IFieldLanguageIndependent-languageindependent-0\n+ Check Checkbox //input[@id="form-widgets-IFieldLanguageIndependent-languageindependent-0"]\n+ Get Checkbox State //input[@id="form-widgets-IFieldLanguageIndependent-languageindependent-0"] == checked\n \n I save the form\n- Wait until page contains element css=#form-buttons-save\n- Click button css=#form-buttons-save\n- Wait until keyword succeeds 1 10 Element should not be visible .plone-modal-wrapper\n+ Get Element //*[@id="form-buttons-save"]\n+ Click //*[@id="form-buttons-save"]\n+ Get Element Count //div[contains(@class,"plone-modal-wrapper")] should be 0\n \n I open the form again\n- Go to ${PLONE_URL}/dexterity-types/Custom/custom\n- Wait until page contains Language independent field\n+ Go to ${PLONE_URL}/dexterity-types/Custom/custom\n+ Get Text //div[@id="form-widgets-IFieldLanguageIndependent-languageindependent"] contains Language independent field\n \n I unselect the language independent field setting\n- Unselect checkbox form-widgets-IFieldLanguageIndependent-languageindependent-0\n- Checkbox should not be selected form-widgets-IFieldLanguageIndependent-languageindependent-0\n+ Uncheck Checkbox //input[@id="form-widgets-IFieldLanguageIndependent-languageindependent-0"]\n+ Get Checkbox State //input[@id="form-widgets-IFieldLanguageIndependent-languageindependent-0"] == unchecked\n \n # Then\n \n I can see the language independent field setting\n- Wait until page contains element id=form-widgets-IFieldLanguageIndependent-languageindependent-0\n+ Get Element //*[@id="form-widgets-IFieldLanguageIndependent-languageindependent-0"]\n \n the language independent field setting is selected\n- Checkbox should be selected form-widgets-IFieldLanguageIndependent-languageindependent-0\n+ Get Checkbox State //input[@id="form-widgets-IFieldLanguageIndependent-languageindependent-0"] == checked\n \n the language independent field setting is not selected\n- Checkbox should not be selected form-widgets-IFieldLanguageIndependent-languageindependent-0\n+ Get Checkbox State //input[@id="form-widgets-IFieldLanguageIndependent-languageindependent-0"] == unchecked\ndiff --git a/src/plone/app/multilingual/tests/robot/test_translate_content.robot b/src/plone/app/multilingual/tests/robot/test_translate_content.robot\nindex 6c3a9d205..355f1e246 100644\n--- a/src/plone/app/multilingual/tests/robot/test_translate_content.robot\n+++ b/src/plone/app/multilingual/tests/robot/test_translate_content.robot\n@@ -1,16 +1,13 @@\n *** Settings ***\n \n-Resource plone/app/robotframework/keywords.robot\n-Resource plone/app/robotframework/saucelabs.robot\n-Resource plone/app/robotframework/selenium.robot\n+Resource plone/app/robotframework/browser.robot\n \n-Library Remote ${PLONE_URL}/RobotRemote\n+Library Remote ${PLONE_URL}/RobotRemote\n \n-Test Setup Run Keywords Plone test setup\n-Test Teardown Run keywords Plone test teardown\n+Test Setup Run Keywords Plone Test Setup\n+Test Teardown Run keywords Plone Test Teardown\n \n-\n-*** Test Cases ***\n+*** Test cases ***\n \n Scenario: As an editor I can translate a document\n Given a site owner\n@@ -24,7 +21,6 @@ Scenario: As a visitor I can view the translation\n When I switch to Catalan\n Then I can view the document in Catalan\n \n-\n *** Keywords ***\n \n # Given\n@@ -32,48 +28,30 @@ Scenario: As a visitor I can view the translation\n a site owner\n Enable autologin as Manager\n \n-a visitor\n- Disable autologin\n-\n a document in English\n- Create content type=Document\n- ... container=/${PLONE_SITE_ID}/en/\n- ... id=an-english-document\n- ... title=An English Document\n+ Create content type=Document container=/${PLONE_SITE_ID}/en/ id=an-english-document title=An English Document\n \n a document in English with Catalan translation\n- ${uid} = Create content type=Document\n- ... container=/${PLONE_SITE_ID}/en/\n- ... id=an-english-document\n- ... title=An English Document\n- Create translation ${uid} ca\n- ... title=A Catalan Document\n- Go to ${PLONE_URL}/resolveuid/${uid}\n- Wait until page contains An English Document\n+ ${uid}= Create content type=Document container=/${PLONE_SITE_ID}/en/ id=an-english-document title=An English Document\n+ Create translation ${uid} ca title=A Catalan Document\n+ Go to ${PLONE_URL}/resolveuid/${uid}\n+ Get Element //h1[1][text()=\'An English Document\']\n \n # When\n \n I translate the document into Catalan\n- Go to ${PLONE_URL}/en/an-english-document/@@create_translation?language=ca\n- Capture page screenshot\n- Input Text form.widgets.IDublinCore.title A Catalan Document\n- Click Link Dates # workaround for of TinyMCE editor field problem\n- Capture page screenshot\n- Click button css=#form-buttons-save\n-\n- # Wait until page contains Element creat\n- # (Catalan translations not currently available)\n-\n- Wait until page contains A Catalan Document\n+ Go to ${PLONE_URL}/en/an-english-document/@@create_translation?language=ca\n+ Take screenshot\n+ Type Text //input[@name="form.widgets.IDublinCore.title"] A Catalan Document\n+ Take screenshot\n+ Click //button[@id="form-buttons-save"]\n \n I switch to Catalan\n- Click Link xpath=//a[@title=\'Catal\xc3\xa0\']\n- Wait until page contains A Catalan Document\n+ Click //a[@title=\'Catal\xc3\xa0\']\n+ Get Element //h1[1][text()=\'A Catalan Document\']\n \n # Then\n \n I can view the document in Catalan\n- Page Should Contain Element\n- ... xpath=//h1[1][text()=\'A Catalan Document\']\n- Page Should Contain Element\n- ... xpath=//ul[@id=\'portal-languageselector\']/li[contains(@class, \'currentLanguage\')]/a[@title=\'Catal\xc3\xa0\']\n+ Get Element //h1[1][text()=\'A Catalan Document\']\n+ Get Element //ul[@id=\'portal-languageselector\']/li[contains(@class, \'currentLanguage\')]/a[@title=\'Catal\xc3\xa0\']\n'