Commit 208cacda authored by Jérome Perrin's avatar Jérome Perrin

km_ui_test: restore test for thumbnails

Rename the test for PDFJS introduced in
b58995c9 to testCheckPDFPreview

Repair original testCheckPDFThumbnail by updating the link name from
Preview to Thumbnail, as a follow up to fe83821b
parent 2ad59942
<?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>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>testCheckPDFPreview</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>
<html xmlns:tal="http://xml.zope.org/namespaces/tal"
xmlns:metal="http://xml.zope.org/namespaces/metal">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>testCheckPDFPreview</title>
</head>
<body>
<table cellpadding="1" cellspacing="1" border="1">
<thead>
<tr><td rowspan="1" colspan="3">testCheckPDFPreview</td></tr>
</thead><tbody>
<tal:block metal:use-macro="here/Zuite_CommonTemplate/macros/init" />
<tal:block metal:use-macro="here/KMZuite_CommonTemplate/macros/createKMWebSite" />
<tr>
<td>openAndWait</td>
<td>${base_url}/web_site_module/km_test_web_site</td>
<td></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>link=New Document</td>
<td></td>
</tr>
<tr>
<td>setFile</td>
<td>field_your_file</td>
<td>${base_url}/functional_test_data_folder/tiolive-ERP5.Freedom.TioLive.MultiplePages.PDF-001-en.pdf tiolive-ERP5.Freedom.TioLive.MultiplePages.PDF-001-en.pdf</td>
</tr>
<tr>
<td>clickAndWait</td>
<td>dialog_submit_button</td>
<td></td>
</tr>
<tr>
<td>verifyTextPresent</td>
<td>successfully</td>
<td></td>
</tr>
<tr>
<td>storeAttribute</td>
<td>//ul[@class="breadcrumb"]//li[3]/a@href</td>
<td>file_url</td>
</tr>
<span metal:use-macro="container/Zuite_CommonTemplate/macros/wait_for_activities"> Wait for activities</span>
<tr>
<td>openAndWait</td>
<td>${file_url}?editable_mode:int=1</td>
<td></td>
</tr>
<tr>
<td>verifyTextPresent</td>
<td>PDF</td>
<td></td>
</tr>
<tr>
<td>verifyValue</td>
<td>field_my_title</td>
<td>TioLive, ERP5, Freedom</td>
</tr>
<tr>
<td>verifyValue</td>
<td>field_my_reference</td>
<td>tiolive-ERP5.Freedom.TioLive.MultiplePages.PDF</td>
</tr>
<tr>
<td>verifyValue</td>
<td>field_my_version</td>
<td>001</td>
</tr>
<tr>
<td>verifyValue</td>
<td>field_my_language</td>
<td>en</td>
</tr>
<tr>
<td>verifyTextPresent</td>
<td>tiolive-ERP5.Freedom.TioLive.MultiplePages.PDF-001-en.pdf</td>
<td></td>
</tr>
<tr>
<td>verifyTextPresent</td>
<td>PDF</td>
<td></td>
</tr>
<!-- Check PDFJS preview appears -->
<tr>
<td>clickAndWait</td>
<td>link=Preview</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[@id='pageContainer1']</td>
<td></td>
</tr>
<tr>
<td>isElementPresent</td>
<td>//button[@id='zoomOut']</td>
<td></td>
</tr>
<tr>
<td>isElementPresent</td>
<td>//button[@id='zoomIn']</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/KMZuite_CommonTemplate/macros/deleteKMWebSite" />
</tbody></table>
</body>
</html>
\ No newline at end of file
......@@ -86,27 +86,179 @@
<td>PDF</td>
<td></td>
</tr>
<!-- Check PDFJS preview appears -->
<!-- Check PDF thumbnail preview works -->
<tr>
<td>clickAndWait</td>
<td>link=Preview</td>
<td>link=Thumbnails</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[@id='pageContainer1']</td>
<td>verifyText</td>
<td>//span[@class="listbox-current-page-start-number"]</td>
<td>1</td>
</tr>
<tr>
<td>verifyText</td>
<td>//span[@class="listbox-current-page-stop-number"]</td>
<td>10</td>
</tr>
<tr>
<td>verifyText</td>
<td>//span[@class="listbox-current-page-total-number"]</td>
<td>16 records</td>
</tr>
<tr>
<td>verifyElementPresent</td>
<td>//img[@title='Thumbnail']</td>
<td></td>
</tr>
<!-- Check PDF thumbnail preview navigation-->
<tr>
<td>clickAndWait</td>
<td>//button[@class="listbox_next_page"]</td>
<td></td>
</tr>
<tr>
<td>verifyText</td>
<td>//span[@class="listbox-current-page-start-number"]</td>
<td>11</td>
</tr>
<tr>
<td>verifyText</td>
<td>//span[@class="listbox-current-page-stop-number"]</td>
<td>16</td>
</tr>
<tr>
<td>verifyText</td>
<td>//span[@class="listbox-current-page-total-number"]</td>
<td>16 records</td>
</tr>
<tr>
<td>verifyElementPresent</td>
<td>//img[@title='Thumbnail']</td>
<td></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>//button[@class="listbox_previous_page"]</td>
<td></td>
</tr>
<tr>
<td>verifyText</td>
<td>//span[@class="listbox-current-page-start-number"]</td>
<td>1</td>
</tr>
<tr>
<td>verifyText</td>
<td>//span[@class="listbox-current-page-stop-number"]</td>
<td>10</td>
</tr>
<tr>
<td>verifyText</td>
<td>//span[@class="listbox-current-page-total-number"]</td>
<td>16 records</td>
</tr>
<tr>
<td>verifyElementPresent</td>
<td>//img[@title='Thumbnail']</td>
<td></td>
</tr>
<!-- Go to PDF default big preview -->
<tr>
<td>clickAndWait</td>
<td>//tr[@class="listbox-data-line-1 DataB"]/td/div/a/img[@title='Thumbnail']</td>
<td></td>
</tr>
<tr>
<td>verifyValue</td>
<td>//input[@name="pdf_selection_index"]</td>
<td>2</td>
</tr>
<tr>
<td>verifyElementPresent</td>
<td>//img[@alt='First']</td>
<td></td>
</tr>
<tr>
<td>isElementPresent</td>
<td>//button[@id='zoomOut']</td>
<td>verifyElementPresent</td>
<td>//img[@alt='Previous']</td>
<td></td>
</tr>
<tr>
<td>isElementPresent</td>
<td>//button[@id='zoomIn']</td>
<td>verifyElementPresent</td>
<td>//img[@alt='Next']</td>
<td></td>
</tr>
<tr>
<td>verifyElementPresent</td>
<td>//img[@alt='Last']</td>
<td></td>
</tr>
<tr>
<td>verifyElementPresent</td>
<td>//div[@class='pdf-preview-content']/img</td>
<td></td>
</tr>
<!-- Check if PDF thumbnail navigation works -->
<tr>
<td>clickAndWait</td>
<td>//img[@alt='Next']</td>
<td></td>
</tr>
<tr>
<td>verifyValue</td>
<td>//input[@name="pdf_selection_index"]</td>
<td>3</td>
</tr>
<tr>
<td>clickAndWait</td>
<td>//img[@alt='First']</td>
<td></td>
</tr>
<tr>
<td>verifyValue</td>
<td>//input[@name="pdf_selection_index"]</td>
<td>1</td>
</tr>
<tr>
<td>clickAndWait</td>
<td>//img[@alt='Last']</td>
<td></td>
</tr>
<tr>
<td>verifyValue</td>
<td>//input[@name="pdf_selection_index"]</td>
<td>16</td>
</tr>
<tr>
<td>clickAndWait</td>
<td>//img[@alt='First']</td>
<td></td>
</tr>
<tr>
<td>verifyValue</td>
<td>//input[@name="pdf_selection_index"]</td>
<td>1</td>
</tr>
<!-- Type in test -->
<tr>
<td>type</td>
<td>//input[@name="pdf_selection_index"]</td>
<td>5</td>
</tr>
<tr>
<td>keyPressAndWait</td>
<td>//input[@name="pdf_selection_index"]</td>
<td>\13</td>
</tr>
<tr>
<td>verifyValue</td>
<td>//input[@name="pdf_selection_index"]</td>
<td>5</td>
</tr>
<tal:block metal:use-macro="here/KMZuite_CommonTemplate/macros/deleteKMWebSite" />
</tbody></table>
......
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