Commit 29a5613d authored by Jérome Perrin's avatar Jérome Perrin

pdm_ui_test: rename "movement_count" in "inventory_list_count"

This was never counting movement, but the number of inventory brain that
the getInventoryList should return.
Document this macro and rename argument everywhere.
parent 9b219d6d
...@@ -15,7 +15,7 @@ Test stock browser for confirmed state ...@@ -15,7 +15,7 @@ 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';
movement_count python: 1; inventory_list_count python: 1;
current_inventory python: 0.0; current_inventory python: 0.0;
available_inventory python: -1.0; available_inventory python: -1.0;
future_inventory python: -1.0; future_inventory python: -1.0;
...@@ -25,7 +25,7 @@ Test stock browser for confirmed state ...@@ -25,7 +25,7 @@ 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';
movement_count python: 1; inventory_list_count python: 1;
current_inventory python: 0.0; current_inventory python: 0.0;
available_inventory python: 0.0; available_inventory python: 0.0;
future_inventory python: 1.0; future_inventory python: 1.0;
......
...@@ -15,7 +15,7 @@ Test stock browser for delivered state ...@@ -15,7 +15,7 @@ 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';
movement_count python: 1; inventory_list_count python: 1;
current_inventory python: -1.0; current_inventory python: -1.0;
available_inventory python: -1.0; available_inventory python: -1.0;
future_inventory python: -1.0; future_inventory python: -1.0;
...@@ -25,7 +25,7 @@ Test stock browser for delivered state ...@@ -25,7 +25,7 @@ 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';
movement_count python: 1; inventory_list_count python: 1;
current_inventory python: 1.0; current_inventory python: 1.0;
available_inventory python: 1.0; available_inventory python: 1.0;
future_inventory python: 1.0; future_inventory python: 1.0;
......
...@@ -15,13 +15,13 @@ Test stock browser for draft state ...@@ -15,13 +15,13 @@ Test stock browser for draft 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';
movement_count python: 0;"> inventory_list_count python: 0;">
<tal:block metal:use-macro="here/PdmZuite_checkStockBrowser/macros/check_inventory" /> <tal:block metal:use-macro="here/PdmZuite_checkStockBrowser/macros/check_inventory" />
</tal:block> </tal:block>
<!-- 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';
movement_count python: 0;"> inventory_list_count python: 0;">
<tal:block metal:use-macro="here/PdmZuite_checkStockBrowser/macros/check_inventory" /> <tal:block metal:use-macro="here/PdmZuite_checkStockBrowser/macros/check_inventory" />
</tal:block> </tal:block>
......
...@@ -17,7 +17,7 @@ Test stock browser with node category preference ...@@ -17,7 +17,7 @@ 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';
select_node_category python:False; select_node_category python:False;
movement_count python: 1; inventory_list_count python: 1;
current_inventory python: 1.0; current_inventory python: 1.0;
available_inventory python: 1.0; available_inventory python: 1.0;
future_inventory python: 1.0; future_inventory python: 1.0;
......
...@@ -15,7 +15,7 @@ Test stock browser for ordered state ...@@ -15,7 +15,7 @@ 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';
movement_count python: 1; inventory_list_count python: 1;
current_inventory python: 0.0; current_inventory python: 0.0;
available_inventory python: 0.0; available_inventory python: 0.0;
future_inventory python: -1.0; future_inventory python: -1.0;
...@@ -25,7 +25,7 @@ Test stock browser for ordered state ...@@ -25,7 +25,7 @@ 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';
movement_count python: 1; inventory_list_count python: 1;
current_inventory python: 0.0; current_inventory python: 0.0;
available_inventory python: 0.0; available_inventory python: 0.0;
future_inventory python: 1.0; future_inventory python: 1.0;
......
...@@ -15,7 +15,7 @@ Test stock browser for planned state ...@@ -15,7 +15,7 @@ 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';
movement_count python: 1; inventory_list_count python: 1;
current_inventory python: 0.0; current_inventory python: 0.0;
available_inventory python: 0.0; available_inventory python: 0.0;
future_inventory python: -1.0; future_inventory python: -1.0;
...@@ -25,7 +25,7 @@ Test stock browser for planned state ...@@ -25,7 +25,7 @@ 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';
movement_count python: 1; inventory_list_count python: 1;
current_inventory python: 0.0; current_inventory python: 0.0;
available_inventory python: 0.0; available_inventory python: 0.0;
future_inventory python: 1.0; future_inventory python: 1.0;
......
...@@ -15,7 +15,7 @@ Test stock browser for ready state ...@@ -15,7 +15,7 @@ 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';
movement_count python: 1; inventory_list_count python: 1;
current_inventory python: 0.0; current_inventory python: 0.0;
available_inventory python: -1.0; available_inventory python: -1.0;
future_inventory python: -1.0; future_inventory python: -1.0;
...@@ -25,7 +25,7 @@ Test stock browser for ready state ...@@ -25,7 +25,7 @@ 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';
movement_count python: 1; inventory_list_count python: 1;
current_inventory python: 0.0; current_inventory python: 0.0;
available_inventory python: 0.0; available_inventory python: 0.0;
future_inventory python: 1.0; future_inventory python: 1.0;
......
...@@ -15,7 +15,7 @@ Test stock browser for started state ...@@ -15,7 +15,7 @@ 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';
movement_count python: 1; inventory_list_count python: 1;
current_inventory python: -1.0; current_inventory python: -1.0;
available_inventory python: -1.0; available_inventory python: -1.0;
future_inventory python: -1.0; future_inventory python: -1.0;
...@@ -25,7 +25,7 @@ Test stock browser for started state ...@@ -25,7 +25,7 @@ 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';
movement_count python: 1; inventory_list_count python: 1;
current_inventory python: 0.0; current_inventory python: 0.0;
available_inventory python: 0.0; available_inventory python: 0.0;
future_inventory python: 1.0; future_inventory python: 1.0;
......
...@@ -15,7 +15,7 @@ Test stock browser for stopped state ...@@ -15,7 +15,7 @@ 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';
movement_count python: 1; inventory_list_count python: 1;
current_inventory python: -1.0; current_inventory python: -1.0;
available_inventory python: -1.0; available_inventory python: -1.0;
future_inventory python: -1.0; future_inventory python: -1.0;
...@@ -25,7 +25,7 @@ Test stock browser for stopped state ...@@ -25,7 +25,7 @@ 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';
movement_count python: 1; inventory_list_count python: 1;
current_inventory python: 1.0; current_inventory python: 1.0;
available_inventory python: 1.0; available_inventory python: 1.0;
future_inventory python: 1.0; future_inventory python: 1.0;
......
...@@ -10,6 +10,23 @@ ...@@ -10,6 +10,23 @@
</tr> </tr>
</tal:block> </tal:block>
<!--
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.
Required parameters:
- node_category: the label of the node category to select in the dialog
- 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();
...@@ -40,9 +57,9 @@ ...@@ -40,9 +57,9 @@
<tr> <tr>
<td>verifyText</td> <td>verifyText</td>
<td>//span[@class="listbox-current-page-total-number"]</td> <td>//span[@class="listbox-current-page-total-number"]</td>
<td tal:content="python: '%s records' % movement_count">number of record(s)</td> <td tal:content="python: '%s records' % inventory_list_count">number of record(s)</td>
</tr> </tr>
<tal:block tal:condition="python: movement_count != 0"> <tal:block tal:condition="python: inventory_list_count != 0">
<!-- Check that inventory and movement list are consistent --> <!-- Check that inventory and movement list are consistent -->
<tal:block tal:repeat="inventory_tuple python: [(current_inventory, 3), <tal:block tal:repeat="inventory_tuple python: [(current_inventory, 3),
...@@ -66,11 +83,19 @@ ...@@ -66,11 +83,19 @@
<td tal:content="python: '//tr[@class=\'listbox-data-line-0 DataA\']/td[%s]/a[1]' % inventory_tuple[1]">link</td> <td tal:content="python: '//tr[@class=\'listbox-data-line-0 DataA\']/td[%s]/a[1]' % inventory_tuple[1]">link</td>
<td></td> <td></td>
</tr> </tr>
<tr>
<!-- we expect to have one movement, except if the inventory was 0, then we should have 0 movements. -->
<tr tal:condition="python: inventory_tuple[0]">
<td>verifyText</td> <td>verifyText</td>
<td>//span[@class="listbox-current-page-total-number"]</td> <td>//span[@class="listbox-current-page-total-number"]</td>
<td tal:content="python: '%s records' % int(abs(inventory_tuple[0]))">number of movement(s)</td> <td>1 records</td>
</tr> </tr>
<tr tal:condition="python: not inventory_tuple[0]">
<td>verifyText</td>
<td>//span[@class="listbox-current-page-total-number"]</td>
<td>0 records</td>
</tr>
<!-- Go back to inventory view --> <!-- Go back to inventory view -->
<tr> <tr>
<td>clickAndWait</td> <td>clickAndWait</td>
......
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