From 9e89cb851e3aeac235a3780c0466c8f48e4b552e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=A9rome=20Perrin?= <jerome@nexedi.com>
Date: Wed, 13 Jan 2010 14:44:50 +0000
Subject: [PATCH] add a test showing that quantity steps do not work with
 default Internal supply on resources

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@31727 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 ...ternal_supply_line_price_quantity_step.xml | 215 ++++++++++++++++++
 bt5/erp5_pdm_ui_test/bt/revision              |   2 +-
 2 files changed, 216 insertions(+), 1 deletion(-)
 create mode 100644 bt5/erp5_pdm_ui_test/PathTemplateItem/portal_tests/pdm_zuite/resource_default_internal_supply_line_price_quantity_step.xml

diff --git a/bt5/erp5_pdm_ui_test/PathTemplateItem/portal_tests/pdm_zuite/resource_default_internal_supply_line_price_quantity_step.xml b/bt5/erp5_pdm_ui_test/PathTemplateItem/portal_tests/pdm_zuite/resource_default_internal_supply_line_price_quantity_step.xml
new file mode 100644
index 0000000000..fc611ea0ea
--- /dev/null
+++ b/bt5/erp5_pdm_ui_test/PathTemplateItem/portal_tests/pdm_zuite/resource_default_internal_supply_line_price_quantity_step.xml
@@ -0,0 +1,215 @@
+<?xml version="1.0"?>
+<ZopeData>
+  <record id="1" aka="AAAAAAAAAAE=">
+    <pickle>
+      <tuple>
+        <global name="ZopePageTemplate" module="Products.PageTemplates.ZopePageTemplate"/>
+        <tuple/>
+      </tuple>
+    </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> <string encoding="cdata"><![CDATA[
+
+<html>\n
+<head><title>Test quantity steps for price on internal supply line</title></head>\n
+<body>\n
+<table cellpadding="1" cellspacing="1" border="1">\n
+<thead>\n
+<tr><td rowspan="1" colspan="4">\n
+Test quantity steps for price on internal supply line\n
+</td></tr>\n
+</thead>\n
+<tbody tal:define="init_method string:PdmZuite_createDelivery?state=draft">\n
+\n
+<!-- Setup {{{ -->\n
+<tal:block metal:use-macro="here/PdmZuite_CommonTemplate/macros/init" />\n
+<!-- }}} -->\n
+\n
+<tr>\n
+  <td>clickAndWait</td>\n
+  <td>link=Internal</td>\n
+  <td></td>\n
+</tr>\n
+<tr>\n
+  <td>type</td>\n
+  <td>field_my_internal_supply_line_quantity_step_list</td>\n
+<tal:block tal:condition="is_selenium_0_8">\n
+  <td>10<br />20</td>\n
+</tal:block>\n
+<tal:block tal:condition="not:is_selenium_0_8">\n
+  <td>10\n
+20</td>\n
+</tal:block>\n
+</tr>\n
+<tr>\n
+  <td>clickAndWait</td>\n
+  <td>Base_edit:method</td>\n
+  <td></td>\n
+</tr>\n
+<tr>\n
+  <td>assertText</td>\n
+  <td>field_my_internal_supply_line_quantity_step_list</td>\n
+  <td>10\n
+20</td>\n
+<tr>\n
+  <td>assertText</td>\n
+  <td>//input[@name="field_matrixbox_base_price_cell_0_0_0"]/../../../td[1]</td>\n
+  <td>Quantity &lt; 10.0</td>\n
+</tr>\n
+<tr>\n
+  <td>assertText</td>\n
+  <td>//input[@name="field_matrixbox_base_price_cell_1_0_0"]/../../../td[1]</td>\n
+  <td>10.0 &lt;= Quantity &lt; 20.0</td>\n
+</tr>\n
+<tr>\n
+  <td>assertText</td>\n
+  <td>//input[@name="field_matrixbox_base_price_cell_2_0_0"]/../../../td[1]</td>\n
+  <td>20.0 &lt;= Quantity</td>\n
+</tr>\n
+\n
+<tr>\n
+  <td>type</td>\n
+  <td>//input[@name="field_matrixbox_base_price_cell_0_0_0"]</td>\n
+  <td>1</td>\n
+</tr>\n
+<tr>\n
+  <td>type</td>\n
+  <td>//input[@name="field_matrixbox_base_price_cell_1_0_0"]</td>\n
+  <td>2</td>\n
+</tr>\n
+<tr>\n
+  <td>type</td>\n
+  <td>//input[@name="field_matrixbox_base_price_cell_2_0_0"]</td>\n
+  <td>3</td>\n
+</tr>\n
+<!-- save and check -->\n
+<tr>\n
+  <td>clickAndWait</td>\n
+  <td>Base_edit:method</td>\n
+  <td></td>\n
+</tr>\n
+<tr>\n
+  <td>assertFloatValue</td>\n
+  <td>//input[@name="field_matrixbox_base_price_cell_0_0_0"]</td>\n
+  <td>1</td>\n
+</tr>\n
+<tr>\n
+  <td>assertFloatValue</td>\n
+  <td>//input[@name="field_matrixbox_base_price_cell_1_0_0"]</td>\n
+  <td>2</td>\n
+</tr>\n
+<tr>\n
+  <td>assertFloatValue</td>\n
+  <td>//input[@name="field_matrixbox_base_price_cell_2_0_0"]</td>\n
+  <td>3</td>\n
+</tr>\n
+\n
+<!-- XXX: the field rounds to int the displayed value. This is strange\n
+-->\n
+\n
+<!-- The field has a validator to prevent from entering values that are non numerics\n
+-->\n
+<tr>\n
+  <td>type</td>\n
+  <td>field_my_internal_supply_line_quantity_step_list</td>\n
+<tal:block tal:condition="is_selenium_0_8">\n
+  <td>foo<br />bar</td>\n
+</tal:block>\n
+<tal:block tal:condition="not:is_selenium_0_8">\n
+  <td>foo\n
+bar</td>\n
+</tal:block>\n
+</tr>\n
+<tr>\n
+  <td>clickAndWait</td>\n
+  <td>Base_edit:method</td>\n
+  <td></td>\n
+</tr>\n
+<tr>\n
+  <td>assertText</td>\n
+  <td>field_my_internal_supply_line_quantity_step_list</td>\n
+  <td>foo\n
+bar</td>\n
+</tr>\n
+<tr>\n
+  <td>assertText</td>\n
+  <td>field_my_internal_supply_line_quantity_step_list</td>\n
+  <td>foo\n
+bar</td>\n
+</tr>\n
+<tr>\n
+  <td>assertText</td>\n
+  <td>//textarea[@name="field_my_internal_supply_line_quantity_step_list"]/parent::div/following-sibling::span</td>\n
+  <td>You did not enter a floating point number.</td>\n
+</tr>\n
+\n
+\n
+\n
+<tr>\n
+  <td>type</td>\n
+  <td>field_my_internal_supply_line_quantity_step_list</td>\n
+  <td></td>\n
+</tr>\n
+<tr>\n
+  <td>clickAndWait</td>\n
+  <td>Base_edit:method</td>\n
+  <td></td>\n
+</tr>\n
+\n
+</tbody></table>\n
+</body>\n
+</html> \n
+<!-- vim: syntax=html foldmethod=marker -->\n
+
+
+]]></string> </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>resource_default_internal_supply_line_price_quantity_step</string> </value>
+        </item>
+        <item>
+            <key> <string>title</string> </key>
+            <value> <string></string> </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+</ZopeData>
diff --git a/bt5/erp5_pdm_ui_test/bt/revision b/bt5/erp5_pdm_ui_test/bt/revision
index dec2bf5d61..2edeafb09d 100644
--- a/bt5/erp5_pdm_ui_test/bt/revision
+++ b/bt5/erp5_pdm_ui_test/bt/revision
@@ -1 +1 @@
-19
\ No newline at end of file
+20
\ No newline at end of file
-- 
2.30.9