Commit 45832eae authored by Ayush Tiwari's avatar Ayush Tiwari

[erp5_web_renderjs_ui_test]: Substitute macros for the notifications in tests

parent 24e3f704
...@@ -55,11 +55,10 @@ ...@@ -55,11 +55,10 @@
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/submit_dialog" /> <tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/submit_dialog" />
<tr> <tal:block tal:define="notification_configuration python: {'class': 'error',
<td>waitForElementPresent</td> 'text': 'Encountered an unknown error. Try to resubmit.'}">
<td>//div[@data-gadget-scope='notification']//button[@class='error']</td> <tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_notification" />
<td></td> </tal:block>
</tr>
</tbody></table> </tbody></table>
</body> </body>
......
...@@ -73,17 +73,12 @@ ...@@ -73,17 +73,12 @@
<td>QWERTY</td> <td>QWERTY</td>
</tr> </tr>
<tr> <tal:block tal:define="notification_configuration python: {'class': 'error',
<td>assertTextPresent</td> 'text': 'Input data has errors.'}">
<td>Input data has errors.</td> <tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_notification" />
<td></td> </tal:block>
</tr>
<tr>
<td>verifyElementPresent</td>
<td>//div[@data-gadget-scope='notification']//button[@class='error']</td>
<td></td>
</tr>
</tbody></table> </tbody></table>
</body> </body>
</html> </html>
\ No newline at end of file
...@@ -70,17 +70,11 @@ ...@@ -70,17 +70,11 @@
<td>Title 1</td> <td>Title 1</td>
<td></td> <td></td>
</tr> </tr>
<tr>
<td>assertTextPresent</td>
<td>Data updated.</td>
<td></td>
</tr>
<tr> <tal:block tal:define="notification_configuration python: {'class': 'success',
<td>verifyElementPresent</td> 'text': 'Data updated.'}">
<td>//div[@data-gadget-scope='notification']//button[@class='success']</td> <tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_notification" />
<td></td> </tal:block>
</tr>
</tbody></table> </tbody></table>
</body> </body>
......
...@@ -44,8 +44,10 @@ Check that user gets notified if there is an error on a hidden field. ...@@ -44,8 +44,10 @@ Check that user gets notified if there is an error on a hidden field.
<td>//button[@data-i18n='Save']</td><td></td></tr> <td>//button[@data-i18n='Save']</td><td></td></tr>
<tr><td>click</td> <tr><td>click</td>
<td>//button[@data-i18n='Save']</td><td></td></tr> <td>//button[@data-i18n='Save']</td><td></td></tr>
<tr><td>waitForTextPresent</td> <tal:block tal:define="notification_configuration python: {'class': 'error',
<td>The input failed the external validator.</td><td></td></tr> 'text': 'Input data has errors.'}">
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_notification" />
</tal:block>
</tbody> </tbody>
</table> </table>
......
...@@ -60,17 +60,11 @@ ...@@ -60,17 +60,11 @@
<td>//div[@data-gadget-url='${base_url}/web_site_module/renderjs_runner/gadget_erp5_pt_form_view_editable.html']</td> <td>//div[@data-gadget-url='${base_url}/web_site_module/renderjs_runner/gadget_erp5_pt_form_view_editable.html']</td>
<td></td> <td></td>
</tr> </tr>
<tr>
<td>assertTextPresent</td>
<td>Status changed.</td>
<td></td>
</tr>
<tr> <tal:block tal:define="notification_configuration python: {'class': 'success',
<td>verifyElementPresent</td> 'text': 'Status changed.'}">
<td>//div[@data-gadget-scope='notification']//button[@class='success']</td> <tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_notification" />
<td></td> </tal:block>
</tr>
</tbody></table> </tbody></table>
</body> </body>
......
...@@ -57,13 +57,14 @@ ...@@ -57,13 +57,14 @@
<td>//input[@type='submit' and @value='Dummy Crashing Workflow Action']</td> <td>//input[@type='submit' and @value='Dummy Crashing Workflow Action']</td>
<td></td> <td></td>
</tr> </tr>
<!-- Wait for the notification to appear. We cannot use verifyText because the button <!-- Wait for the notification to appear. We cannot use verifyText because the button
is there all the time. It gets text assigned and is shown asynchronously later. --> is there all the time. It gets text assigned and is shown asynchronously later. -->
<tr> <tal:block tal:define="notification_configuration python: {'class': 'error',
<td>waitForElementPresent</td> 'text': 'Encountered an unknown error. Try to resubmit.'}">
<td>//div[@data-gadget-scope='notification']/button[text()='Encountered an unknown error. Try to resubmit.']</td> <tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_notification" />
<td></td> </tal:block>
</tr>
<!-- Modified form data must stay after the notification --> <!-- Modified form data must stay after the notification -->
<tr> <tr>
<td>verifyValue</td> <td>verifyValue</td>
......
...@@ -66,11 +66,12 @@ ...@@ -66,11 +66,12 @@
</tr> </tr>
<!-- Wait for the notification to appear. We cannot use verifyText because the button <!-- Wait for the notification to appear. We cannot use verifyText because the button
is there all the time. It gets text assigned and is shown asynchronously later. --> is there all the time. It gets text assigned and is shown asynchronously later. -->
<tr>
<td>waitForElementPresent</td> <tal:block tal:define="notification_configuration python: {'class': 'error',
<td>//div[@data-gadget-scope='notification']/button[text()='Encountered an unknown error. Try to resubmit.']</td> 'text': 'Encountered an unknown error. Try to resubmit.'}">
<td></td> <tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_notification" />
</tr> </tal:block>
<!-- Modified form data must stay after the notification --> <!-- Modified form data must stay after the notification -->
<tr> <tr>
<td>verifyValue</td> <td>verifyValue</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