Commit de2757b4 authored by Jérome Perrin's avatar Jérome Perrin

web_renderjs_ui_test: simplify tests by using macros

Also fix a few copy/pasted test titles.
parent 7278881d
...@@ -16,55 +16,15 @@ ...@@ -16,55 +16,15 @@
<td>${base_url}/web_site_module/renderjs_runner/#/foo_module/1?editable=true</td> <td>${base_url}/web_site_module/renderjs_runner/#/foo_module/1?editable=true</td>
<td></td> <td></td>
</tr> </tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_app_loaded" />
<!-- Wait for gadget to be loaded -->
<tr>
<td>waitForElementPresent</td>
<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>waitForTextPresent</td>
<td>Title 1</td>
<td></td>
</tr>
<!-- Header has a save button -->
<tr>
<td>assertElementPresent</td>
<td>//div[@data-gadget-scope='header']//button[text()='Save' and @type='submit']</td>
<td></td>
</tr>
<tr> <tr>
<td>type</td> <td>type</td>
<td>field_my_title</td> <td>field_my_title</td>
<td>Custom Message</td> <td>Custom Message</td>
</tr> </tr>
<tr>
<td>click</td> <tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/click_save" />
<td>//div[@data-gadget-scope='header']//button[text()='Save' and @type='submit']</td>
<td></td>
</tr>
<tr>
<td>pause</td>
<td>1000</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[@data-gadget-scope='header']//button[text()='Save' and @type='submit' and contains(@class, 'ui-icon-check')]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[@data-gadget-scope='header']//a[text()='Foo: Custom Message' and contains(@href, '#!history_previous')]</td>
<td></td>
</tr>
<tr>
<td>assertTextNotPresent</td>
<td>Title 1</td>
<td></td>
</tr>
<tal:block tal:define="notification_configuration python: {'class': 'error', <tal:block tal:define="notification_configuration python: {'class': 'error',
'text': 'Custom Message.'}"> 'text': 'Custom Message.'}">
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
<body> <body>
<table cellpadding="1" cellspacing="1" border="1"> <table cellpadding="1" cellspacing="1" border="1">
<thead> <thead>
<tr><td rowspan="1" colspan="3">Test Default Module View</td></tr> <tr><td rowspan="1" colspan="3">Test Form View Editable Save Action</td></tr>
</thead><tbody> </thead><tbody>
<tal:block metal:use-macro="here/PTZuite_CommonTemplate/macros/init" /> <tal:block metal:use-macro="here/PTZuite_CommonTemplate/macros/init" />
...@@ -17,59 +17,15 @@ ...@@ -17,59 +17,15 @@
<td></td> <td></td>
</tr> </tr>
<!-- Wait for gadget to be loaded --> <tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_app_loaded" />
<tr>
<td>waitForElementPresent</td>
<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>waitForTextPresent</td>
<td>Title 1</td>
<td></td>
</tr>
<!-- Header has a save button -->
<tr>
<td>assertElementPresent</td>
<td>//div[@data-gadget-scope='header']//button[text()='Save' and @type='submit']</td>
<td></td>
</tr>
<tr> <tr>
<td>type</td> <td>type</td>
<td>field_my_title</td> <td>field_my_title</td>
<td>QWERTY</td> <td>QWERTY</td>
</tr> </tr>
<tr>
<td>click</td> <tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/click_save" />
<td>//div[@data-gadget-scope='header']//button[text()='Save' and @type='submit']</td>
<td></td>
</tr>
<tr>
<td>pause</td>
<td>1000</td>
<td></td>
</tr>
<!--tr>
<td>waitForElementPresent</td>
<td>//div[@data-gadget-scope='header']//button[text()='Save' and @type='submit' and contains(@class, 'ui-icon-spinner')]</td>
<td></td>
</tr-->
<tr>
<td>waitForElementPresent</td>
<td>//div[@data-gadget-scope='header']//button[text()='Save' and @type='submit' and contains(@class, 'ui-icon-check')]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[@data-gadget-scope='header']//a[text()='Foo: QWERTY' and contains(@href, '#!history_previous')]</td>
<td></td>
</tr>
<tr>
<td>assertTextNotPresent</td>
<td>Title 1</td>
<td></td>
</tr>
<tal:block tal:define="notification_configuration python: {'class': 'success', <tal:block tal:define="notification_configuration python: {'class': 'success',
'text': 'Data updated.'}"> 'text': 'Data updated.'}">
......
...@@ -2,45 +2,22 @@ ...@@ -2,45 +2,22 @@
xmlns:metal="http://xml.zope.org/namespaces/metal"> xmlns:metal="http://xml.zope.org/namespaces/metal">
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Test RenderJS UI</title> <title>Test No Confirmation when Form Content Saved</title>
</head> </head>
<body> <body>
<table cellpadding="1" cellspacing="1" border="1"> <table cellpadding="1" cellspacing="1" border="1">
<thead> <thead>
<tr><td rowspan="1" colspan="3">Test RenderJS UI</td></tr> <tr><td rowspan="1" colspan="3">Test No Confirmation when Form Content Saved</td></tr>
</thead><tbody> </thead><tbody>
<tal:block metal:use-macro="here/Zuite_CommonTemplate/macros/init" /> <tal:block metal:use-macro="here/PTZuite_CommonTemplate/macros/init" />
<!-- Clean Up -->
<tr>
<td>open</td>
<td>${base_url}/foo_module/ListBoxZuite_reset</td>
<td></td>
</tr>
<tr>
<td>assertTextPresent</td>
<td>Reset Successfully.</td>
<td></td>
</tr>
<!-- Initialize --> <!-- Initialize -->
<tr> <tr>
<td>open</td> <td>open</td>
<td>${base_url}/web_site_module/renderjs_runner/#/foo_module</td> <td>${base_url}/web_site_module/renderjs_runner/#/foo_module/1?editable=true</td>
<td></td> <td></td>
</tr> </tr>
<tr> <tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_app_loaded" />
<td>waitForElementPresent</td>
<td>//a[@data-i18n='Add']</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>link=Add</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/submit_dialog" />
<tr> <tr>
<td>waitForElementPresent</td> <td>waitForElementPresent</td>
......
...@@ -2,46 +2,22 @@ ...@@ -2,46 +2,22 @@
xmlns:metal="http://xml.zope.org/namespaces/metal"> xmlns:metal="http://xml.zope.org/namespaces/metal">
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Test RenderJS UI</title> <title>Test Page Action non Confirmation</title>
</head> </head>
<body> <body>
<table cellpadding="1" cellspacing="1" border="1"> <table cellpadding="1" cellspacing="1" border="1">
<thead> <thead>
<tr><td rowspan="1" colspan="3">Test RenderJS UI</td></tr> <tr><td rowspan="1" colspan="3">Test Page Action non Confirmation</td></tr>
</thead><tbody> </thead><tbody>
<tal:block metal:use-macro="here/Zuite_CommonTemplate/macros/init" /> <tal:block metal:use-macro="here/PTZuite_CommonTemplate/macros/init" />
<!-- Clean Up -->
<tr>
<td>open</td>
<td>${base_url}/bar_module/ListBoxZuite_reset</td>
<td></td>
</tr>
<tr>
<td>assertTextPresent</td>
<td>Reset Successfully.</td>
<td></td>
</tr>
<!-- Initialize --> <!-- Initialize -->
<tr> <tr>
<td>open</td> <td>open</td>
<td>${base_url}/web_site_module/renderjs_runner/#/foo_module</td> <td>${base_url}/web_site_module/renderjs_runner/#/foo_module/1?editable=true</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//a[@data-i18n='Add']</td>
<td></td> <td></td>
</tr> </tr>
<tr> <tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_app_loaded" />
<td>click</td>
<td>link=Add</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/submit_dialog" />
<tr> <tr>
<td>waitForElementPresent</td> <td>waitForElementPresent</td>
......
...@@ -2,45 +2,23 @@ ...@@ -2,45 +2,23 @@
xmlns:metal="http://xml.zope.org/namespaces/metal"> xmlns:metal="http://xml.zope.org/namespaces/metal">
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Test RenderJS UI</title> <title>Test EDitable with Confirmation</title>
</head> </head>
<body> <body>
<table cellpadding="1" cellspacing="1" border="1"> <table cellpadding="1" cellspacing="1" border="1">
<thead> <thead>
<tr><td rowspan="1" colspan="3">Test RenderJS UI</td></tr> <tr><td rowspan="1" colspan="3">Test EDitable with Confirmation</td></tr>
</thead><tbody> </thead><tbody>
<tal:block metal:use-macro="here/Zuite_CommonTemplate/macros/init" />
<!-- Clean Up --> <tal:block metal:use-macro="here/PTZuite_CommonTemplate/macros/init" />
<tr>
<td>open</td>
<td>${base_url}/bar_module/ListBoxZuite_reset</td>
<td></td>
</tr>
<tr>
<td>assertTextPresent</td>
<td>Reset Successfully.</td>
<td></td>
</tr>
<!-- Initialize --> <!-- Initialize -->
<tr> <tr>
<td>open</td> <td>open</td>
<td>${base_url}/web_site_module/renderjs_runner/#/foo_module</td> <td>${base_url}/web_site_module/renderjs_runner/#/foo_module/1?editable=true</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//a[@data-i18n='Add']</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>link=Add</td>
<td></td> <td></td>
</tr> </tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_app_loaded" />
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/submit_dialog" />
<tr> <tr>
<td>waitForElementPresent</td> <td>waitForElementPresent</td>
......
...@@ -2,27 +2,15 @@ ...@@ -2,27 +2,15 @@
xmlns:metal="http://xml.zope.org/namespaces/metal"> xmlns:metal="http://xml.zope.org/namespaces/metal">
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Test RenderJS UI</title> <title>Test Form List non Confirmation</title>
</head> </head>
<body> <body>
<table cellpadding="1" cellspacing="1" border="1"> <table cellpadding="1" cellspacing="1" border="1">
<thead> <thead>
<tr><td rowspan="1" colspan="3">Test RenderJS UI</td></tr> <tr><td rowspan="1" colspan="3">Test Form List non Confirmation</td></tr>
</thead><tbody> </thead><tbody>
<tal:block metal:use-macro="here/Zuite_CommonTemplate/macros/init" /> <tal:block metal:use-macro="here/Zuite_CommonTemplate/macros/init" />
<!-- Clean Up -->
<tr>
<td>open</td>
<td>${base_url}/foo_module/ListBoxZuite_reset</td>
<td></td>
</tr>
<tr>
<td>assertTextPresent</td>
<td>Reset Successfully.</td>
<td></td>
</tr>
<!-- Initialize --> <!-- Initialize -->
<tr> <tr>
<td>open</td> <td>open</td>
......
...@@ -2,12 +2,12 @@ ...@@ -2,12 +2,12 @@
xmlns:metal="http://xml.zope.org/namespaces/metal"> xmlns:metal="http://xml.zope.org/namespaces/metal">
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Test Form View Editable Save Action</title> <title>Test Workflow Transition Fail</title>
</head> </head>
<body> <body>
<table cellpadding="1" cellspacing="1" border="1"> <table cellpadding="1" cellspacing="1" border="1">
<thead> <thead>
<tr><td rowspan="1" colspan="3">Test Default Module View</td></tr> <tr><td rowspan="1" colspan="3">Test Workflow Transition Fail</td></tr>
</thead><tbody> </thead><tbody>
<tal:block metal:use-macro="here/PTZuite_CommonTemplate/macros/init" /> <tal:block metal:use-macro="here/PTZuite_CommonTemplate/macros/init" />
......
...@@ -2,12 +2,12 @@ ...@@ -2,12 +2,12 @@
xmlns:metal="http://xml.zope.org/namespaces/metal"> xmlns:metal="http://xml.zope.org/namespaces/metal">
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Test Form View Editable Save Action</title> <title>Test Workflow Transition Pass</title>
</head> </head>
<body> <body>
<table cellpadding="1" cellspacing="1" border="1"> <table cellpadding="1" cellspacing="1" border="1">
<thead> <thead>
<tr><td rowspan="1" colspan="3">Test Default Module View</td></tr> <tr><td rowspan="1" colspan="3">Test Workflow Transition Pass</td></tr>
</thead><tbody> </thead><tbody>
<tal:block metal:use-macro="here/PTZuite_CommonTemplate/macros/init" /> <tal:block metal:use-macro="here/PTZuite_CommonTemplate/macros/init" />
......
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