From 6fcdd08365242916f8a0ae829c18b8b139eb39e5 Mon Sep 17 00:00:00 2001
From: Ivan Tyagov <ivan@nexedi.com>
Date: Tue, 9 Nov 2010 16:00:02 +0000
Subject: [PATCH] Add basic Image embedding test for FCKEditor.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@40125 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 ...stContributeAndEmbedImageWithFCKEditor.xml | 189 ++++++++++++++++++
 bt5/erp5_dms_ui_test/bt/revision              |   2 +-
 2 files changed, 190 insertions(+), 1 deletion(-)
 create mode 100644 bt5/erp5_dms_ui_test/PathTemplateItem/portal_tests/dms_zuite/testContributeAndEmbedImageWithFCKEditor.xml

diff --git a/bt5/erp5_dms_ui_test/PathTemplateItem/portal_tests/dms_zuite/testContributeAndEmbedImageWithFCKEditor.xml b/bt5/erp5_dms_ui_test/PathTemplateItem/portal_tests/dms_zuite/testContributeAndEmbedImageWithFCKEditor.xml
new file mode 100644
index 0000000000..fdd8fbb42f
--- /dev/null
+++ b/bt5/erp5_dms_ui_test/PathTemplateItem/portal_tests/dms_zuite/testContributeAndEmbedImageWithFCKEditor.xml
@@ -0,0 +1,189 @@
+<?xml version="1.0"?>
+<ZopeData>
+  <record id="1" aka="AAAAAAAAAAE=">
+    <pickle>
+      <global name="ZopePageTemplate" module="Products.PageTemplates.ZopePageTemplate"/>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>_bind_names</string> </key>
+            <value>
+              <object>
+                <klass>
+                  <global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
+                </klass>
+                <tuple/>
+                <state>
+                  <dictionary>
+                    <item>
+                        <key> <string>_asgns</string> </key>
+                        <value>
+                          <dictionary>
+                            <item>
+                                <key> <string>name_subpath</string> </key>
+                                <value> <string>traverse_subpath</string> </value>
+                            </item>
+                          </dictionary>
+                        </value>
+                    </item>
+                  </dictionary>
+                </state>
+              </object>
+            </value>
+        </item>
+        <item>
+            <key> <string>_text</string> </key>
+            <value> <unicode encoding="cdata"><![CDATA[
+
+<html xmlns:tal="http://xml.zope.org/namespaces/tal"\n
+      xmlns:metal="http://xml.zope.org/namespaces/metal">\n
+<head>\n
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">\n
+<title>Express Access Tab</title>\n
+</head>\n
+<body>\n
+<table cellpadding="1" cellspacing="1" border="1">\n
+<thead>\n
+<tr><td rowspan="1" colspan="3">Contribute Tab</td></tr>\n
+</thead><tbody>\n
+\n
+<tal:block metal:use-macro="here/Zuite_CommonTemplate/macros/init" />\n
+<tr>\n
+  <td>openAndWait</td>\n
+  <td>${base_url}/person_module/Zuite_setupDMS</td>\n
+  <td></td>\n
+</tr>\n
+<tr>\n
+  <td>verifyTextPresent</td>\n
+  <td>Done</td>\n
+  <td></td>\n
+</tr>\n
+\n
+<span metal:use-macro="container/Zuite_CommonTemplate/macros/wait_for_activities">\n
+Wait for activities</span>\n
+\n
+<!-- Contribute Image -->\n
+<tr>\n
+  <td>openAndWait</td>\n
+  <td>${base_url}/view?erp5_site_selected_tab=contribution_tab</td>\n
+  <td></td>\n
+</tr>\n
+<tr>\n
+  <td>waitForCondition</td>\n
+  <td>selenium.isElementPresent("file")</td>\n
+  <td>60000</td>\n
+</tr>\n
+<tr>\n
+  <td>type</td>\n
+  <td>file</td>\n
+  <td tal:content="python: here.Zuite_getFilenameLocation(\'tiolive-ERP5.Freedom.TioLive.Logo-001-en.png\')"></td>\n
+</tr>\n
+<tr>\n
+  <td>clickAndWait</td>\n
+  <td>Base_contribute:method</td>\n
+  <td></td>\n
+</tr>\n
+<tr>\n
+  <td>verifyValue</td>\n
+  <td>field_my_title</td>\n
+  <td>tiolive-ERP5.Freedom.TioLive.Logo-001-en</td>\n
+</tr>\n
+<tr>\n
+  <td>verifyValue</td>\n
+  <td>field_my_reference</td>\n
+  <td>tiolive-ERP5.Freedom.TioLive.Logo</td>\n
+</tr>\n
+<tr>\n
+  <td>verifyValue</td>\n
+  <td>field_my_language</td>\n
+  <td>en</td>\n
+</tr>\n
+<tr>\n
+  <td>verifyValue</td>\n
+  <td>field_my_version</td>\n
+  <td>001</td>\n
+</tr>\n
+<tr>\n
+  <td>verifyTextPresent</td>\n
+  <td>tiolive-ERP5.Freedom.TioLive.Logo-001-en.png</td>\n
+  <td></td>\n
+</tr>\n
+<tr>\n
+  <td>verifyTextPresent</td>\n
+  <td>Image</td>\n
+  <td></td>\n
+</tr>\n
+<tr>\n
+  <td>selectAndWait</td>\n
+  <td>select_action</td>\n
+  <td>label=Publish Document</td>\n
+</tr>\n
+<tr>\n
+  <td>type</td>\n
+  <td>field_your_comment</td>\n
+  <td>ok</td>\n
+</tr>\n
+<tr>\n
+  <td>clickAndWait</td>\n
+  <td>dialog_submit_button</td>\n
+  <td></td>\n
+</tr>\n
+<tr>\n
+  <td>assertTextPresent</td>\n
+  <td>Status changed</td>\n
+  <td></td>\n
+</tr>\n
+\n
+<span metal:use-macro="container/Zuite_CommonTemplate/macros/wait_for_activities">\n
+Wait for activities</span>\n
+\n
+<!-- FCKeditor uses iframes which makes its testing in Selenium unreliable.\n
+     so we test that ERP5 form which it uses itself. -->\n
+<tr>\n
+  <td>openAndWait</td>\n
+  <td>${base_url}/FCKeditor_viewImageSelectionDialog</td>\n
+  <td></td>\n
+</tr>\n
+<!-- javascript:SelectFile(\'tiolive-ERP5.Freedom.TioLive.Logo?format=png\') -->\n
+<tr>\n
+  <td>verifyTextPresent</td>\n
+  <td>tiolive-ERP5.Freedom.TioLive.Logo-001-en</td>\n
+  <td></td>\n
+</tr>\n
+<tr>\n
+  <td>verifyElementPresent</td>\n
+  <td>//a[@href="javascript:SelectFile(\'tiolive-ERP5.Freedom.TioLive.Logo?format=png\')"]</td>\n
+  <td></td>\n
+</tr>\n
+\n
+</tbody></table>\n
+</body>\n
+</html>
+
+]]></unicode> </value>
+        </item>
+        <item>
+            <key> <string>content_type</string> </key>
+            <value> <string>text/html</string> </value>
+        </item>
+        <item>
+            <key> <string>expand</string> </key>
+            <value> <int>0</int> </value>
+        </item>
+        <item>
+            <key> <string>id</string> </key>
+            <value> <string>testContributeAndEmbedImageWithFCKEditor</string> </value>
+        </item>
+        <item>
+            <key> <string>output_encoding</string> </key>
+            <value> <string>utf-8</string> </value>
+        </item>
+        <item>
+            <key> <string>title</string> </key>
+            <value> <unicode></unicode> </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+</ZopeData>
diff --git a/bt5/erp5_dms_ui_test/bt/revision b/bt5/erp5_dms_ui_test/bt/revision
index 2edeafb09d..b5045cc404 100644
--- a/bt5/erp5_dms_ui_test/bt/revision
+++ b/bt5/erp5_dms_ui_test/bt/revision
@@ -1 +1 @@
-20
\ No newline at end of file
+21
\ No newline at end of file
-- 
2.30.9