Commit 7b5c900b authored by Jérome Perrin's avatar Jérome Perrin

pdm_renderjs_ui_test: rename "movement_count" to "inventory_list_count"

At the same time:
 - don't cast to int() in macro, but expect caller to pass already
   correctly formatted values for *_inventory
 - document macro like it was done for erp5_pdm_ui_test
parent 29a5613d
...@@ -17,10 +17,10 @@ Test stock browser for components portal type ...@@ -17,10 +17,10 @@ Test stock browser for components portal type
<!-- Check source --> <!-- Check source -->
<tal:block tal:define="node_category python: 'erp5_pdm_ui_test_source_site_title'; <tal:block tal:define="node_category python: 'erp5_pdm_ui_test_source_site_title';
node_title string: erp5_pdm_ui_test_source_node_title; node_title string: erp5_pdm_ui_test_source_node_title;
movement_count python: 1; inventory_list_count python: 1;
current_inventory python: -1.0; current_inventory python: -1;
available_inventory python: -1.0; available_inventory python: -1;
future_inventory python: -1.0; future_inventory python: -1;
"> ">
<tal:block metal:use-macro="here/PdmZuite_checkStockBrowserForRenderjsUi/macros/check_inventory" /> <tal:block metal:use-macro="here/PdmZuite_checkStockBrowserForRenderjsUi/macros/check_inventory" />
</tal:block> </tal:block>
...@@ -28,10 +28,10 @@ Test stock browser for components portal type ...@@ -28,10 +28,10 @@ Test stock browser for components portal type
<!-- Check destination --> <!-- Check destination -->
<tal:block tal:define="node_category python: 'erp5_pdm_ui_test_destination_site_title'; <tal:block tal:define="node_category python: 'erp5_pdm_ui_test_destination_site_title';
node_title string: erp5_pdm_ui_test_destination_node_title; node_title string: erp5_pdm_ui_test_destination_node_title;
movement_count python: 1; inventory_list_count python: 1;
current_inventory python: 1.0; current_inventory python: 1;
available_inventory python: 1.0; available_inventory python: 1;
future_inventory python: 1.0; future_inventory python: 1;
"> ">
<tal:block metal:use-macro="here/PdmZuite_checkStockBrowserForRenderjsUi/macros/check_inventory" /> <tal:block metal:use-macro="here/PdmZuite_checkStockBrowserForRenderjsUi/macros/check_inventory" />
</tal:block> </tal:block>
......
...@@ -16,10 +16,10 @@ Test stock browser for confirmed state ...@@ -16,10 +16,10 @@ Test stock browser for confirmed state
<!-- Check source --> <!-- Check source -->
<tal:block tal:define="node_category python: 'erp5_pdm_ui_test_source_site_title'; <tal:block tal:define="node_category python: 'erp5_pdm_ui_test_source_site_title';
node_title string: erp5_pdm_ui_test_source_node_title; node_title string: erp5_pdm_ui_test_source_node_title;
movement_count python: 1; inventory_list_count python: 1;
current_inventory python: 0.0; current_inventory python: 0;
available_inventory python: -1.0; available_inventory python: -1;
future_inventory python: -1.0; future_inventory python: -1;
"> ">
<tal:block metal:use-macro="here/PdmZuite_checkStockBrowserForRenderjsUi/macros/check_inventory" /> <tal:block metal:use-macro="here/PdmZuite_checkStockBrowserForRenderjsUi/macros/check_inventory" />
</tal:block> </tal:block>
...@@ -27,10 +27,10 @@ Test stock browser for confirmed state ...@@ -27,10 +27,10 @@ Test stock browser for confirmed state
<!-- Check destination --> <!-- Check destination -->
<tal:block tal:define="node_category python: 'erp5_pdm_ui_test_destination_site_title'; <tal:block tal:define="node_category python: 'erp5_pdm_ui_test_destination_site_title';
node_title string: erp5_pdm_ui_test_destination_node_title; node_title string: erp5_pdm_ui_test_destination_node_title;
movement_count python: 1; inventory_list_count python: 1;
current_inventory python: 0.0; current_inventory python: 0;
available_inventory python: 0.0; available_inventory python: 0;
future_inventory python: 1.0; future_inventory python: 1;
"> ">
<tal:block metal:use-macro="here/PdmZuite_checkStockBrowserForRenderjsUi/macros/check_inventory" /> <tal:block metal:use-macro="here/PdmZuite_checkStockBrowserForRenderjsUi/macros/check_inventory" />
</tal:block> </tal:block>
......
...@@ -16,10 +16,10 @@ Test stock browser for delivered state ...@@ -16,10 +16,10 @@ Test stock browser for delivered state
<!-- Check source --> <!-- Check source -->
<tal:block tal:define="node_category python: 'erp5_pdm_ui_test_source_site_title'; <tal:block tal:define="node_category python: 'erp5_pdm_ui_test_source_site_title';
node_title string: erp5_pdm_ui_test_source_node_title; node_title string: erp5_pdm_ui_test_source_node_title;
movement_count python: 1; inventory_list_count python: 1;
current_inventory python: -1.0; current_inventory string: -1;
available_inventory python: -1.0; available_inventory string: -1;
future_inventory python: -1.0; future_inventory string: -1;
"> ">
<tal:block metal:use-macro="here/PdmZuite_checkStockBrowserForRenderjsUi/macros/check_inventory" /> <tal:block metal:use-macro="here/PdmZuite_checkStockBrowserForRenderjsUi/macros/check_inventory" />
</tal:block> </tal:block>
...@@ -27,10 +27,10 @@ Test stock browser for delivered state ...@@ -27,10 +27,10 @@ Test stock browser for delivered state
<!-- Check destination --> <!-- Check destination -->
<tal:block tal:define="node_category python: 'erp5_pdm_ui_test_destination_site_title'; <tal:block tal:define="node_category python: 'erp5_pdm_ui_test_destination_site_title';
node_title string: erp5_pdm_ui_test_destination_node_title; node_title string: erp5_pdm_ui_test_destination_node_title;
movement_count python: 1; inventory_list_count python: 1;
current_inventory python: 1.0; current_inventory string: 1;
available_inventory python: 1.0; available_inventory string: 1;
future_inventory python: 1.0; future_inventory string: 1;
"> ">
<tal:block metal:use-macro="here/PdmZuite_checkStockBrowserForRenderjsUi/macros/check_inventory" /> <tal:block metal:use-macro="here/PdmZuite_checkStockBrowserForRenderjsUi/macros/check_inventory" />
</tal:block> </tal:block>
......
...@@ -17,10 +17,10 @@ Test stock browser with node category preference ...@@ -17,10 +17,10 @@ Test stock browser with node category preference
<!-- Check destination --> <!-- Check destination -->
<tal:block tal:define="node_category python: 'erp5_pdm_ui_test_destination_site_title'; <tal:block tal:define="node_category python: 'erp5_pdm_ui_test_destination_site_title';
node_title string: erp5_pdm_ui_test_destination_node_title; node_title string: erp5_pdm_ui_test_destination_node_title;
movement_count python: 1; inventory_list_count python: 1;
current_inventory python: 1.0; current_inventory python: 1;
available_inventory python: 1.0; available_inventory python: 1;
future_inventory python: 1.0; future_inventory python: 1;
"> ">
<tal:block metal:use-macro="here/PdmZuite_checkStockBrowserForRenderjsUi/macros/check_inventory" /> <tal:block metal:use-macro="here/PdmZuite_checkStockBrowserForRenderjsUi/macros/check_inventory" />
</tal:block> </tal:block>
......
...@@ -16,10 +16,10 @@ Test stock browser for ordered state ...@@ -16,10 +16,10 @@ Test stock browser for ordered state
<!-- Check source --> <!-- Check source -->
<tal:block tal:define="node_category python: 'erp5_pdm_ui_test_source_site_title'; <tal:block tal:define="node_category python: 'erp5_pdm_ui_test_source_site_title';
node_title string: erp5_pdm_ui_test_source_node_title; node_title string: erp5_pdm_ui_test_source_node_title;
movement_count python: 1; inventory_list_count python: 1;
current_inventory python: 0.0; current_inventory python: 0;
available_inventory python: 0.0; available_inventory python: 0;
future_inventory python: -1.0; future_inventory python: -1;
"> ">
<tal:block metal:use-macro="here/PdmZuite_checkStockBrowserForRenderjsUi/macros/check_inventory" /> <tal:block metal:use-macro="here/PdmZuite_checkStockBrowserForRenderjsUi/macros/check_inventory" />
</tal:block> </tal:block>
...@@ -27,10 +27,10 @@ Test stock browser for ordered state ...@@ -27,10 +27,10 @@ Test stock browser for ordered state
<!-- Check destination --> <!-- Check destination -->
<tal:block tal:define="node_category python: 'erp5_pdm_ui_test_destination_site_title'; <tal:block tal:define="node_category python: 'erp5_pdm_ui_test_destination_site_title';
node_title string: erp5_pdm_ui_test_destination_node_title; node_title string: erp5_pdm_ui_test_destination_node_title;
movement_count python: 1; inventory_list_count python: 1;
current_inventory python: 0.0; current_inventory python: 0;
available_inventory python: 0.0; available_inventory python: 0;
future_inventory python: 1.0; future_inventory python: 1;
"> ">
<tal:block metal:use-macro="here/PdmZuite_checkStockBrowserForRenderjsUi/macros/check_inventory" /> <tal:block metal:use-macro="here/PdmZuite_checkStockBrowserForRenderjsUi/macros/check_inventory" />
</tal:block> </tal:block>
......
...@@ -16,10 +16,10 @@ Test stock browser for planned state ...@@ -16,10 +16,10 @@ Test stock browser for planned state
<!-- Check source --> <!-- Check source -->
<tal:block tal:define="node_category python: 'erp5_pdm_ui_test_source_site_title'; <tal:block tal:define="node_category python: 'erp5_pdm_ui_test_source_site_title';
node_title string: erp5_pdm_ui_test_source_node_title; node_title string: erp5_pdm_ui_test_source_node_title;
movement_count python: 1; inventory_list_count python: 1;
current_inventory python: 0.0; current_inventory python: 0;
available_inventory python: 0.0; available_inventory python: 0;
future_inventory python: -1.0; future_inventory python: -1;
"> ">
<tal:block metal:use-macro="here/PdmZuite_checkStockBrowserForRenderjsUi/macros/check_inventory" /> <tal:block metal:use-macro="here/PdmZuite_checkStockBrowserForRenderjsUi/macros/check_inventory" />
</tal:block> </tal:block>
...@@ -27,10 +27,10 @@ Test stock browser for planned state ...@@ -27,10 +27,10 @@ Test stock browser for planned state
<!-- Check destination --> <!-- Check destination -->
<tal:block tal:define="node_category python: 'erp5_pdm_ui_test_destination_site_title'; <tal:block tal:define="node_category python: 'erp5_pdm_ui_test_destination_site_title';
node_title string: erp5_pdm_ui_test_destination_node_title; node_title string: erp5_pdm_ui_test_destination_node_title;
movement_count python: 1; inventory_list_count python: 1;
current_inventory python: 0.0; current_inventory python: 0;
available_inventory python: 0.0; available_inventory python: 0;
future_inventory python: 1.0; future_inventory python: 1;
"> ">
<tal:block metal:use-macro="here/PdmZuite_checkStockBrowserForRenderjsUi/macros/check_inventory" /> <tal:block metal:use-macro="here/PdmZuite_checkStockBrowserForRenderjsUi/macros/check_inventory" />
</tal:block> </tal:block>
......
...@@ -16,10 +16,10 @@ Test stock browser for ready state ...@@ -16,10 +16,10 @@ Test stock browser for ready state
<!-- Check source --> <!-- Check source -->
<tal:block tal:define="node_category python: 'erp5_pdm_ui_test_source_site_title'; <tal:block tal:define="node_category python: 'erp5_pdm_ui_test_source_site_title';
node_title string: erp5_pdm_ui_test_source_node_title; node_title string: erp5_pdm_ui_test_source_node_title;
movement_count python: 1; inventory_list_count python: 1;
current_inventory python: 0.0; current_inventory python: 0;
available_inventory python: -1.0; available_inventory python: -1;
future_inventory python: -1.0; future_inventory python: -1;
"> ">
<tal:block metal:use-macro="here/PdmZuite_checkStockBrowserForRenderjsUi/macros/check_inventory" /> <tal:block metal:use-macro="here/PdmZuite_checkStockBrowserForRenderjsUi/macros/check_inventory" />
</tal:block> </tal:block>
...@@ -27,10 +27,10 @@ Test stock browser for ready state ...@@ -27,10 +27,10 @@ Test stock browser for ready state
<!-- Check destination --> <!-- Check destination -->
<tal:block tal:define="node_category python: 'erp5_pdm_ui_test_destination_site_title'; <tal:block tal:define="node_category python: 'erp5_pdm_ui_test_destination_site_title';
node_title string: erp5_pdm_ui_test_destination_node_title; node_title string: erp5_pdm_ui_test_destination_node_title;
movement_count python: 1; inventory_list_count python: 1;
current_inventory python: 0.0; current_inventory python: 0;
available_inventory python: 0.0; available_inventory python: 0;
future_inventory python: 1.0; future_inventory python: 1;
"> ">
<tal:block metal:use-macro="here/PdmZuite_checkStockBrowserForRenderjsUi/macros/check_inventory" /> <tal:block metal:use-macro="here/PdmZuite_checkStockBrowserForRenderjsUi/macros/check_inventory" />
</tal:block> </tal:block>
......
...@@ -16,10 +16,10 @@ Test stock browser for started state ...@@ -16,10 +16,10 @@ Test stock browser for started state
<!-- Check source --> <!-- Check source -->
<tal:block tal:define="node_category python: 'erp5_pdm_ui_test_source_site_title'; <tal:block tal:define="node_category python: 'erp5_pdm_ui_test_source_site_title';
node_title string: erp5_pdm_ui_test_source_node_title; node_title string: erp5_pdm_ui_test_source_node_title;
movement_count python: 1; inventory_list_count python: 1;
current_inventory python: -1.0; current_inventory python: -1;
available_inventory python: -1.0; available_inventory python: -1;
future_inventory python: -1.0; future_inventory python: -1;
"> ">
<tal:block metal:use-macro="here/PdmZuite_checkStockBrowserForRenderjsUi/macros/check_inventory" /> <tal:block metal:use-macro="here/PdmZuite_checkStockBrowserForRenderjsUi/macros/check_inventory" />
</tal:block> </tal:block>
...@@ -27,10 +27,10 @@ Test stock browser for started state ...@@ -27,10 +27,10 @@ Test stock browser for started state
<!-- Check destination --> <!-- Check destination -->
<tal:block tal:define="node_category python: 'erp5_pdm_ui_test_destination_site_title'; <tal:block tal:define="node_category python: 'erp5_pdm_ui_test_destination_site_title';
node_title string: erp5_pdm_ui_test_destination_node_title; node_title string: erp5_pdm_ui_test_destination_node_title;
movement_count python: 1; inventory_list_count python: 1;
current_inventory python: 0.0; current_inventory python: 0;
available_inventory python: 0.0; available_inventory python: 0;
future_inventory python: 1.0; future_inventory python: 1;
"> ">
<tal:block metal:use-macro="here/PdmZuite_checkStockBrowserForRenderjsUi/macros/check_inventory" /> <tal:block metal:use-macro="here/PdmZuite_checkStockBrowserForRenderjsUi/macros/check_inventory" />
</tal:block> </tal:block>
......
...@@ -16,10 +16,10 @@ Test stock browser for stopped state ...@@ -16,10 +16,10 @@ Test stock browser for stopped state
<!-- Check source --> <!-- Check source -->
<tal:block tal:define="node_category python: 'erp5_pdm_ui_test_source_site_title'; <tal:block tal:define="node_category python: 'erp5_pdm_ui_test_source_site_title';
node_title string: erp5_pdm_ui_test_source_node_title; node_title string: erp5_pdm_ui_test_source_node_title;
movement_count python: 1; inventory_list_count python: 1;
current_inventory python: -1.0; current_inventory python: -1;
available_inventory python: -1.0; available_inventory python: -1;
future_inventory python: -1.0; future_inventory python: -1;
"> ">
<tal:block metal:use-macro="here/PdmZuite_checkStockBrowserForRenderjsUi/macros/check_inventory" /> <tal:block metal:use-macro="here/PdmZuite_checkStockBrowserForRenderjsUi/macros/check_inventory" />
</tal:block> </tal:block>
...@@ -27,10 +27,10 @@ Test stock browser for stopped state ...@@ -27,10 +27,10 @@ Test stock browser for stopped state
<!-- Check destination --> <!-- Check destination -->
<tal:block tal:define="node_category python: 'erp5_pdm_ui_test_destination_site_title'; <tal:block tal:define="node_category python: 'erp5_pdm_ui_test_destination_site_title';
node_title string: erp5_pdm_ui_test_destination_node_title; node_title string: erp5_pdm_ui_test_destination_node_title;
movement_count python: 1; inventory_list_count python: 1;
current_inventory python: 1.0; current_inventory python: 1;
available_inventory python: 1.0; available_inventory python: 1;
future_inventory python: 1.0; future_inventory python: 1;
"> ">
<tal:block metal:use-macro="here/PdmZuite_checkStockBrowserForRenderjsUi/macros/check_inventory" /> <tal:block metal:use-macro="here/PdmZuite_checkStockBrowserForRenderjsUi/macros/check_inventory" />
</tal:block> </tal:block>
......
<tal:block xmlns:tal="http://xml.zope.org/namespaces/tal" <tal:block xmlns:tal="http://xml.zope.org/namespaces/tal"
xmlns:metal="http://xml.zope.org/namespaces/metal"> xmlns:metal="http://xml.zope.org/namespaces/metal">
<!--
Macro to check inventory displayed in stock browser.
This selects the node category and check each of the current, available and future
inventory match. Then for each value, it will click to "drill down" and check that the
movement history list show the expected number of lines.
TODO: this is not yet the case for renderjs version of this test, the drill down is
still only covered in erp5_xhtml_style
Required parameters:
- node_category: the label of the node category to select in the dialog
- node_title: the label of the node organisation expected in the listbox
- inventory_list_count: the number of "invenvory list" lines expected in the first dialog.
- current_inventory: the quantity for the current inventory
- available_inventory: the quantity for the available inventory
- future_inventory: the quantity for the future inventory
Optional parameters:
- select_node_category: if True (the default) the node category will be selected
-->
<tal:block <tal:block
metal:define-macro="check_inventory" metal:define-macro="check_inventory"
tal:define="base_url python: '/' + here.getPortalObject().getId(); tal:define="base_url python: '/' + here.getPortalObject().getId();
...@@ -27,7 +48,7 @@ ...@@ -27,7 +48,7 @@
</tal:block> </tal:block>
<!-- Check inventory total records --> <!-- Check inventory total records -->
<tal:block tal:define="pagination_configuration python: {'header': '(%s)' % movement_count, 'footer': '%s Records' % movement_count}"> <tal:block tal:define="pagination_configuration python: {'header': '(%s)' % inventory_list_count, 'footer': '%s Records' % inventory_list_count}">
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/check_listbox_pagination_text" /> <tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/check_listbox_pagination_text" />
</tal:block> </tal:block>
...@@ -46,7 +67,7 @@ ...@@ -46,7 +67,7 @@
<tr> <tr>
<td>assertText</td> <td>assertText</td>
<td tal:content="python: '//div[@data-gadget-scope=\'field_listbox\']//table/tbody/tr[1]/td[%s]' % (inventory_tuple[1])">inventory value</td> <td tal:content="python: '//div[@data-gadget-scope=\'field_listbox\']//table/tbody/tr[1]/td[%s]' % (inventory_tuple[1])">inventory value</td>
<td tal:content="python: int(inventory_tuple[0])"></td> <td tal:content="python: inventory_tuple[0]"></td>
</tr> </tr>
</tal:block> </tal:block>
<tr> <tr>
...@@ -60,17 +81,17 @@ ...@@ -60,17 +81,17 @@
<tr> <tr>
<td>assertText</td> <td>assertText</td>
<td>//div[@data-gadget-scope='field_listbox']//table/tfoot/tr[1]/td[3]</td> <td>//div[@data-gadget-scope='field_listbox']//table/tfoot/tr[1]/td[3]</td>
<td tal:content="python: int(current_inventory)"></td> <td tal:content="python: current_inventory"></td>
</tr> </tr>
<tr> <tr>
<td>assertText</td> <td>assertText</td>
<td>//div[@data-gadget-scope='field_listbox']//table/tfoot/tr[1]/td[4]</td> <td>//div[@data-gadget-scope='field_listbox']//table/tfoot/tr[1]/td[4]</td>
<td tal:content="python: int(available_inventory)"></td> <td tal:content="python: available_inventory"></td>
</tr> </tr>
<tr> <tr>
<td>assertText</td> <td>assertText</td>
<td>//div[@data-gadget-scope='field_listbox']//table/tfoot/tr[1]/td[5]</td> <td>//div[@data-gadget-scope='field_listbox']//table/tfoot/tr[1]/td[5]</td>
<td tal:content="python: int(future_inventory)"></td> <td tal:content="python: future_inventory"></td>
</tr> </tr>
<tr> <tr>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment