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 @@
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/submit_dialog" />
<tr>
<td>waitForElementPresent</td>
<td>//div[@data-gadget-scope='notification']//button[@class='error']</td>
<td></td>
</tr>
<tal:block tal:define="notification_configuration python: {'class': 'error',
'text': 'Encountered an unknown error. Try to resubmit.'}">
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_notification" />
</tal:block>
</tbody></table>
</body>
......
......@@ -73,17 +73,12 @@
<td>QWERTY</td>
</tr>
<tr>
<td>assertTextPresent</td>
<td>Input data has errors.</td>
<td></td>
</tr>
<tal:block tal:define="notification_configuration python: {'class': 'error',
'text': 'Input data has errors.'}">
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_notification" />
</tal:block>
<tr>
<td>verifyElementPresent</td>
<td>//div[@data-gadget-scope='notification']//button[@class='error']</td>
<td></td>
</tr>
</tbody></table>
</body>
</html>
\ No newline at end of file
......@@ -70,17 +70,11 @@
<td>Title 1</td>
<td></td>
</tr>
<tr>
<td>assertTextPresent</td>
<td>Data updated.</td>
<td></td>
</tr>
<tr>
<td>verifyElementPresent</td>
<td>//div[@data-gadget-scope='notification']//button[@class='success']</td>
<td></td>
</tr>
<tal:block tal:define="notification_configuration python: {'class': 'success',
'text': 'Data updated.'}">
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_notification" />
</tal:block>
</tbody></table>
</body>
......
......@@ -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>
<tr><td>click</td>
<td>//button[@data-i18n='Save']</td><td></td></tr>
<tr><td>waitForTextPresent</td>
<td>The input failed the external validator.</td><td></td></tr>
<tal:block tal:define="notification_configuration python: {'class': 'error',
'text': 'Input data has errors.'}">
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_notification" />
</tal:block>
</tbody>
</table>
......
......@@ -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></td>
</tr>
<tr>
<td>assertTextPresent</td>
<td>Status changed.</td>
<td></td>
</tr>
<tr>
<td>verifyElementPresent</td>
<td>//div[@data-gadget-scope='notification']//button[@class='success']</td>
<td></td>
</tr>
<tal:block tal:define="notification_configuration python: {'class': 'success',
'text': 'Status changed.'}">
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_notification" />
</tal:block>
</tbody></table>
</body>
......
......@@ -57,13 +57,14 @@
<td>//input[@type='submit' and @value='Dummy Crashing Workflow Action']</td>
<td></td>
</tr>
<!-- 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. -->
<tr>
<td>waitForElementPresent</td>
<td>//div[@data-gadget-scope='notification']/button[text()='Encountered an unknown error. Try to resubmit.']</td>
<td></td>
</tr>
<tal:block tal:define="notification_configuration python: {'class': 'error',
'text': 'Encountered an unknown error. Try to resubmit.'}">
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_notification" />
</tal:block>
<!-- Modified form data must stay after the notification -->
<tr>
<td>verifyValue</td>
......
......@@ -66,11 +66,12 @@
</tr>
<!-- 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. -->
<tr>
<td>waitForElementPresent</td>
<td>//div[@data-gadget-scope='notification']/button[text()='Encountered an unknown error. Try to resubmit.']</td>
<td></td>
</tr>
<tal:block tal:define="notification_configuration python: {'class': 'error',
'text': 'Encountered an unknown error. Try to resubmit.'}">
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_notification" />
</tal:block>
<!-- Modified form data must stay after the notification -->
<tr>
<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