Commit d3571fc7 authored by Gabriel Monnerat's avatar Gabriel Monnerat

erp5_document_scanner_ui_test: Improve test to cover all buttons

parent 73eca3b4
...@@ -91,7 +91,7 @@ ...@@ -91,7 +91,7 @@
</tr> </tr>
<div tal:repeat="item python:range(2)"> <div tal:repeat="item python:range(2)">
<!-- Click on Capture -->
<tr> <tr>
<td>waitForElementPresent</td> <td>waitForElementPresent</td>
<td>//button[@class="take-picture-btn ui-btn-icon-left ui-icon-circle"]</td> <td>//button[@class="take-picture-btn ui-btn-icon-left ui-icon-circle"]</td>
...@@ -102,11 +102,17 @@ ...@@ -102,11 +102,17 @@
<td>//button[@class="take-picture-btn ui-btn-icon-left ui-icon-circle"]</td> <td>//button[@class="take-picture-btn ui-btn-icon-left ui-icon-circle"]</td>
<td></td> <td></td>
</tr> </tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[@class="cropper-wrap-box"]</td>
<td></td>
</tr>
<tr> <tr>
<td>waitForElementPresent</td> <td>waitForElementPresent</td>
<td>//button[@class="reset-btn ui-btn-icon-left ui-icon-times"]</td> <td>//button[@class="reset-btn ui-btn-icon-left ui-icon-times"]</td>
<td></td> <td></td>
</tr> </tr>
<!-- Click on Delete -->
<tr> <tr>
<td>click</td> <td>click</td>
<td>//button[@class="reset-btn ui-btn-icon-left ui-icon-times"]</td> <td>//button[@class="reset-btn ui-btn-icon-left ui-icon-times"]</td>
...@@ -117,6 +123,7 @@ ...@@ -117,6 +123,7 @@
<td>//button[@class="take-picture-btn ui-btn-icon-left ui-icon-circle"]</td> <td>//button[@class="take-picture-btn ui-btn-icon-left ui-icon-circle"]</td>
<td></td> <td></td>
</tr> </tr>
<!-- Click on Capture again -->
<tr> <tr>
<td>click</td> <td>click</td>
<td>//button[@class="take-picture-btn ui-btn-icon-left ui-icon-circle"]</td> <td>//button[@class="take-picture-btn ui-btn-icon-left ui-icon-circle"]</td>
...@@ -127,6 +134,7 @@ ...@@ -127,6 +134,7 @@
<td>//button[@class="confirm-btn ui-btn-icon-left ui-icon-check"]</td> <td>//button[@class="confirm-btn ui-btn-icon-left ui-icon-check"]</td>
<td></td> <td></td>
</tr> </tr>
<!-- Click on Confirm -->
<tr> <tr>
<td>click</td> <td>click</td>
<td>//button[@class="confirm-btn ui-btn-icon-left ui-icon-check"]</td> <td>//button[@class="confirm-btn ui-btn-icon-left ui-icon-check"]</td>
...@@ -137,18 +145,110 @@ ...@@ -137,18 +145,110 @@
<td>//button[@class="take-picture-btn ui-btn-icon-left ui-icon-circle"]</td> <td>//button[@class="take-picture-btn ui-btn-icon-left ui-icon-circle"]</td>
<td></td> <td></td>
</tr> </tr>
<!-- wait upload starts -->
<tr> <tr>
<td>waitForElementPresent</td> <td>waitForElementPresent</td>
<td>//button[@class="ui-btn-icon-left ui-icon-spinner"]</td> <td>//button[@class="ui-btn-icon-left ui-icon-spinner"]</td>
<td></td> <td></td>
</tr> </tr>
</div> </div>
<!-- wait upload finish -->
<tr>
<td>waitForElementNotPresent</td>
<td>//button[@class="ui-btn-icon-left ui-icon-spinner"]</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//button[@class="new-btn ui-btn-icon-left ui-icon-plus" and @disabled]</td>
<td></td>
</tr>
<!-- check if first image exists -->
<tr>
<td>assertElementPresent</td>
<td>//img[@data-page="0" and @class="show-img"]</td>
<td></td>
</tr>
<!-- check if second image exists -->
<tr>
<td>assertElementPresent</td>
<td>//img[@data-page="1" and @class="show-img"]</td>
<td></td>
</tr>
<!-- check if third image does not exists -->
<tr>
<td>assertElementNotPresent</td>
<td>//img[@data-page="2" and @class="show-img"]</td>
<td></td>
</tr>
<!-- open first image -->
<tr>
<td>click</td>
<td>//img[@data-page="0" and @class="show-img"]</td>
<td></td>
</tr>
<!-- check if delete button appears -->
<tr>
<td>waitForElementPresent</td>
<td>//button[@class="delete-btn ui-btn-icon-left ui-icon-times"]</td>
<td></td>
</tr>
<tr>
<td>assertElementNotPresent</td>
<td>//button[@class="new-btn ui-btn-icon-left ui-icon-plus" and @disabled]</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//button[@class="new-btn ui-btn-icon-left ui-icon-plus"]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//button[@class="take-picture-btn ui-btn-icon-left ui-icon-circle"]</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//button[@class="take-picture-btn ui-btn-icon-left ui-icon-circle"]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[@class="cropper-wrap-box"]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//button[@class="confirm-btn ui-btn-icon-left ui-icon-check"]</td>
<td></td>
</tr>
<!-- Click on Confirm -->
<tr>
<td>click</td>
<td>//button[@class="confirm-btn ui-btn-icon-left ui-icon-check"]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//button[@class="take-picture-btn ui-btn-icon-left ui-icon-circle"]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//button[@class="ui-btn-icon-left ui-icon-spinner"]</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//img[@data-page="2" and @class="show-img"]</td>
<td></td>
</tr>
<tr> <tr>
<td>waitForElementNotPresent</td> <td>waitForElementNotPresent</td>
<td>//button[@class="ui-btn-icon-left ui-icon-spinner"]</td> <td>//button[@class="ui-btn-icon-left ui-icon-spinner"]</td>
<td></td> <td></td>
</tr> </tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/submit_dialog" /> <tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/submit_dialog" />
<tal:block tal:define="notification_configuration python: {'class': 'success', <tal:block tal:define="notification_configuration python: {'class': 'success',
...@@ -204,12 +304,12 @@ ...@@ -204,12 +304,12 @@
</tr> </tr>
<tr> <tr>
<td>waitForTextPresent</td> <td>waitForTextPresent</td>
<td>of 2</td> <td>of 3</td>
<td></td> <td></td>
</tr> </tr>
<tr> <tr>
<td>assertTextPresent</td> <td>assertTextPresent</td>
<td>of 2</td> <td>of 3</td>
<td></td> <td></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