text: <html>
  <head><title>Test stock browser for stopped state</title></head>
  <body>
  <table cellpadding="1" cellspacing="1" border="1">
  <thead>
  <tr><td rowspan="1" colspan="4">
  Test stock browser for stopped state
  </td></tr>
  </thead>
  <tbody tal:define="init_method string:PdmZuite_createDelivery?state=stopped">
  
  <!-- Setup {{{ -->
  <tal:block metal:use-macro="here/PdmZuite_CommonTemplateForRenderjsUi/macros/init" />
  <tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_listbox_loaded" />
  
  <!-- Check source -->
  <tal:block tal:define="node_category python: 'erp5_pdm_ui_test_source_site_title';
                         node_title string: erp5_pdm_ui_test_source_node_title;
                         inventory_list_count python: 1;
                         current_inventory python: -1;
                         available_inventory python: -1;
                         future_inventory python: -1;
                         ">
    <tal:block metal:use-macro="here/PdmZuite_checkStockBrowserForRenderjsUi/macros/check_inventory" />
  </tal:block>
  
  <!-- Check destination -->
  <tal:block tal:define="node_category python: 'erp5_pdm_ui_test_destination_site_title';
                         node_title string: erp5_pdm_ui_test_destination_node_title;
                         inventory_list_count python: 1;
                         current_inventory python: 1;
                         available_inventory python: 1;
                         future_inventory python: 1;
                         ">
    <tal:block metal:use-macro="here/PdmZuite_checkStockBrowserForRenderjsUi/macros/check_inventory" />
  </tal:block>
  
  <tal:block metal:use-macro="here/PdmZuite_CommonTemplateForRenderjsUi/macros/check_links_for_stocks" />
  
  <!-- Check the links in hardcoded way -->
  <!-- TODO: If possible, move to macros -->
  <tr>
    <td>waitForElementPresent</td>
    <td>//div[@data-gadget-scope='field_listbox']//table/tbody/tr[1]/td[1]/a</td>
    <td></td>
  </tr>
  <tr>
    <td>click</td>
    <td>//div[@data-gadget-scope='field_listbox']//table/tbody/tr[1]/td[1]/a</td>
    <td></td>
  </tr>
  <tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_listbox_loaded" />
  <tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_content_loaded" />
  
  <tal:block tal:define="pagination_configuration python: {'header': '(1)', 'footer': '1 Records'}">
    <tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/check_listbox_pagination_text" />
  </tal:block>
  
  <tr>
    <td>waitForElementPresent</td>
    <td>//div[@data-gadget-scope='field_listbox']//table/tbody</td>
    <td></td>
  </tr>
  <tr>
    <td>verifyText</td>
    <td>//div[@data-gadget-scope='field_listbox']//table/tbody/tr[1]/td[3]</td>
    <td>erp5_pdm_ui_test_destination_node_title</td>
  </tr>
  
  <tal:block metal:use-macro="here/PdmZuite_CommonTemplateForRenderjsUi/macros/check_links" />
  <tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_listbox_loaded" />
  
  <tr>
    <td>assertElementPresent</td>
    <td>//div[@data-gadget-scope='field_listbox']//table/tbody/tr[1]/td[5]/a</td>
    <td></td>
  </tr>
  
  </tbody></table>
  </body>
  </html>
  <!-- vim: syntax=html foldmethod=marker -->