Commit 12552890 authored by Boxiang Sun's avatar Boxiang Sun Committed by Romain Courteaud

erp5_officejs_support_request_ui_test: let the tests fail faster

Add some assertElementPresent right after the waitForElementPresent to stop the stop in case of missing element.
parent 7ed4d8dd
......@@ -59,6 +59,11 @@
<td>//input[@data-i18n="[value]Post Comment"]</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//input[@data-i18n="[value]Post Comment"]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Comments:</td>
......@@ -104,6 +109,11 @@
<td>//p[contains(text(), "RobotMaking")]</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//p[contains(text(), "RobotMaking")]</td>
<td></td>
</tr>
<tr>
<td>assertTextNotPresent</td>
<td>Requester</td>
......
......@@ -57,6 +57,11 @@
<td>//select[@id="field_your_resource"]/option[text()="FeatureRequire"]</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//select[@id="field_your_resource"]/option[text()="FeatureRequire"]</td>
<td></td>
</tr>
<tr>
<td>select</td>
<td>field_your_resource</td>
......@@ -73,6 +78,11 @@
<td>//input[@data-i18n="[value]Post Comment"]</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//input[@data-i18n="[value]Post Comment"]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Comments:</td>
......@@ -154,6 +164,11 @@
<td>//div[@data-gadget-scope='notification' and @class='visible']//button[@class='success' and text()='Comment added']</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//div[@data-gadget-scope='notification' and @class='visible']//button[@class='success' and text()='Comment added']</td>
<td></td>
</tr>
<tr>
<td>openAndWait</td>
<td tal:content="string: ${here/portal_url}/Zuite_waitForActivities"></td>
......@@ -174,11 +189,21 @@
<td tal:content="string:Post test ${filename}"></td>
<td></td>
</tr>
<tr>
<td>assertTextPresent</td>
<td tal:content="string:Post test ${filename}"></td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>attachment</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>attachment</td>
<td></td>
</tr>
</tal:block>
<tr>
<td>waitForElementPresent</td>
......@@ -244,6 +269,11 @@
<td>//p[contains(text(), '${current_reference}')]</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//p[contains(text(), '${current_reference}')]</td>
<td></td>
</tr>
</tal:block>
<!-- Attached documents can also be found from "Documents" action -->
......
......@@ -42,12 +42,21 @@
<td>//select[@name="field_your_project"]/option[text() = "RobotMaking"]</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//select[@name="field_your_project"]/option[text() = "RobotMaking"]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//select[@name="field_your_project"]/option[text() = "Second Project"]</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//select[@name="field_your_project"]/option[text() = "Second Project"]</td>
<td></td>
</tr>
<tr>
<td>select</td>
......@@ -60,6 +69,11 @@
<td>//select[@name="field_your_resource"]/option[text() = "RequireAssistant"]</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//select[@name="field_your_resource"]/option[text() = "RequireAssistant"]</td>
<td></td>
</tr>
<tr>
<td>waitForElementNotPresent</td>
<td>//select[@name="field_your_resource"]/option[text() = "BugReport"]</td>
......@@ -77,11 +91,21 @@
<td>//select[@name="field_your_resource"]/option[text() = "BugReport"]</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//select[@name="field_your_resource"]/option[text() = "BugReport"]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//select[@name="field_your_resource"]/option[text() = "RequireAssistant"]</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//select[@name="field_your_resource"]/option[text() = "RequireAssistant"]</td>
<td></td>
</tr>
<tr>
<td>select</td>
......
......@@ -41,6 +41,11 @@
<td>//select[@name="field_your_resource"]/option[text() = "FeatureRequire"]</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//select[@name="field_your_resource"]/option[text() = "FeatureRequire"]</td>
<td></td>
</tr>
<!-- this default project have a a sale supply line, defining that only FeatureRequire and
RequireAssistant services are available for this project -->
<tr>
......@@ -48,6 +53,11 @@ RequireAssistant services are available for this project -->
<td>//select[@name="field_your_resource"]/option[text() = "RequireAssistant"]</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//select[@name="field_your_resource"]/option[text() = "RequireAssistant"]</td>
<td></td>
</tr>
<!-- other services are not available here. -->
<tr>
<td>waitForElementNotPresent</td>
......
......@@ -19,16 +19,31 @@
<td>//input[@data-i18n='[value]Submit New Support Request']</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//input[@data-i18n='[value]Submit New Support Request']</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[@id='wrap1']</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//div[@id='wrap1']</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[@id='wrap2']</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//div[@id='wrap2']</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Recent Updates</td>
......
......@@ -20,6 +20,11 @@
<td>//input[@data-i18n='[value]Submit New Support Request']</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//input[@data-i18n='[value]Submit New Support Request']</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/paginate_next" />
<tr>
<td>refresh</td>
......
......@@ -65,6 +65,11 @@
<td>//input[@data-i18n="[value]Post Comment"]</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//input[@data-i18n="[value]Post Comment"]</td>
<td></td>
</tr>
<tal:block tal:define="text_content string:Second Post Content">
<tal:block metal:use-macro="container/Zuite_CommonTemplateForRenderjsUi/macros/type_ckeditor_text_content"/>
......@@ -80,6 +85,11 @@
<td>//input[@data-i18n='[value]Post Comment' and @disabled and contains(@class, "ui-disabled")]</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//input[@data-i18n='[value]Post Comment' and @disabled and contains(@class, "ui-disabled")]</td>
<td></td>
</tr>
<tal:block tal:define="notification_configuration python: {'class': 'success',
'text': 'Comment added'}">
......
......@@ -18,6 +18,8 @@
<!-- reset filter is disabled -->
<tr><td>waitForElementPresent</td>
<td>//input[@data-i18n="[value]Reset Filter" and @disabled]</td><td></td></tr>
<tr><td>assertElementPresent</td>
<td>//input[@data-i18n="[value]Reset Filter" and @disabled]</td><td></td></tr>
<tr><td>waitForElementPresent</td>
<td>css=#wrap2 iframe</td><td></td></tr>
......@@ -25,8 +27,12 @@
<td>css=#wrap2 iframe</td><td></td></tr>
<tr><td>waitForElementPresent</td>
<td>//canvas</td><td></td></tr>
<tr><td>assertElementPresent</td>
<td>//canvas</td><td></td></tr>
<tr><td>waitForElementPresent</td>
<td>//div[@class="graph-content" and not(@disabled)]</td><td></td></tr>
<tr><td>assertElementPresent</td>
<td>//div[@class="graph-content" and not(@disabled)]</td><td></td></tr>
<tr><td>storeEval</td>
<td>selenium.browserbot.getCurrentWindow().echarts.getInstanceByDom(
......@@ -150,6 +156,8 @@ and compare real click with simulated clicks.
<!-- reset filter is now enabled -->
<tr><td>waitForElementPresent</td>
<td>//input[@data-i18n="[value]Reset Filter" and not(@disabled)]</td><td></td></tr>
<tr><td>assertElementPresent</td>
<td>//input[@data-i18n="[value]Reset Filter" and not(@disabled)]</td><td></td></tr>
<tr><td>assertTextNotPresent</td>
<td>123dsfa</td>
<td></td></tr>
......
......@@ -18,7 +18,8 @@
<!-- reset filter is disabled -->
<tr><td>waitForElementPresent</td>
<td>//input[@data-i18n="[value]Reset Filter" and @disabled]</td><td></td></tr>
<tr><td>assertElementPresent</td>
<td>//input[@data-i18n="[value]Reset Filter" and @disabled]</td><td></td></tr>
<tr><td>waitForElementPresent</td>
<td>css=#wrap1 iframe</td><td></td></tr>
......@@ -26,8 +27,12 @@
<td>css=#wrap1 iframe</td><td></td></tr>
<tr><td>waitForElementPresent</td>
<td>//canvas</td><td></td></tr>
<tr><td>assertElementPresent</td>
<td>//canvas</td><td></td></tr>
<tr><td>waitForElementPresent</td>
<td>//div[@class="graph-content" and not(@disabled)]</td><td></td></tr>
<tr><td>assertElementPresent</td>
<td>//div[@class="graph-content" and not(@disabled)]</td><td></td></tr>
<tr><td>storeEval</td>
<td>selenium.browserbot.getCurrentWindow().echarts.getInstanceByDom(
......@@ -152,6 +157,8 @@ The approximated formula (by trial and error, so it migth be just wrong) is:
<!-- reset filter is now enabled -->
<tr><td>waitForElementPresent</td>
<td>//input[@data-i18n="[value]Reset Filter" and not(@disabled)]</td><td></td></tr>
<tr><td>assertElementPresent</td>
<td>//input[@data-i18n="[value]Reset Filter" and not(@disabled)]</td><td></td></tr>
<tr><td>click</td>
<td>//input[@data-i18n="[value]Reset Filter"]</td><td></td></tr>
......
......@@ -19,11 +19,21 @@
<td>//input[@data-i18n='[value]Submit New Support Request']</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//input[@data-i18n='[value]Submit New Support Request']</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//a[@data-i18n="Support Requests"]</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//a[@data-i18n="Support Requests"]</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[@data-i18n="Support Requests"]</td>
......@@ -34,6 +44,11 @@
<td>//a[contains(text(), "Actions")]</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//a[contains(text(), "Actions")]</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[contains(text(), "Actions")]</td>
......@@ -45,6 +60,11 @@
<td>//a[contains(text(), "Generate RSS")]</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//a[contains(text(), "Generate RSS")]</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[contains(text(), "Generate RSS")]</td>
......@@ -55,6 +75,11 @@
<td>//button[contains(text(), "Copy to Clipboard")]</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//button[contains(text(), "Copy to Clipboard")]</td>
<td></td>
</tr>
<tr>
<td>assertValue</td>
<td>//div[@data-gadget-scope="text_field"]/input</td>
......
......@@ -19,11 +19,21 @@
<td>//input[@data-i18n='[value]Submit New Support Request']</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//input[@data-i18n='[value]Submit New Support Request']</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//button[@class="search_button ui-btn-icon-notext ui-icon-search"]</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//button[@class="search_button ui-btn-icon-notext ui-icon-search"]</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//button[@class="search_button ui-btn-icon-notext ui-icon-search"]</td>
......
......@@ -20,14 +20,44 @@
<td>//input[@data-i18n='[value]Submit New Support Request']</td><td></td></tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_content_loaded" />
<tr>
<td>assertElementPresent</td>
<td>//input[@name='field_your_title']</td>
<td></td>
</tr>
<tr><td>type</td>
<td>//input[@name='field_your_title']</td>
<td>testLatestPostOnFrontPage</td></tr>
<!-- Wait for the gadget to update the resource according to the project type,
this done by an ajax call.-->
<tr>
<td>waitForElementPresent</td>
<td>//option[@text="BugReport"]</td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//option[@text="BugReport"]</td>
</tr>
<tr><td>select</td>
<td>field_your_project</td>
<td>RobotMaking</td></tr>
<tr><td>waitForTextPresent</td>
<td>FeatureRequire</td></tr>
<td>field_your_project</td>
<td>RobotMaking</td>
</tr>
<tr>
<td>waitForElementNotPresent</td>
<td>//option[@text="BugReport"]</td>
</tr>
<tr>
<td>assertElementNotPresent</td>
<td>//option[@text="BugReport"]</td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//option[@text="FeatureRequire"]</td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//option[@text="FeatureRequire"]</td>
</tr>
<tr><td>select</td>
<td>field_your_resource</td>
<td>FeatureRequire</td></tr>
......@@ -44,7 +74,9 @@
<tr><td>waitForText</td>
<td>//ol[@id="post_list"]//li/p</td>
<td>Post test</td></tr>
<tr><td>assertText</td>
<td>//ol[@id="post_list"]//li/p</td>
<td>Post test</td></tr>
<tr><td colspan="3"><b>Go back ot front page and check "latest post" columns</b></td></tr>
<tr><td>openAndWait</td>
......
......@@ -24,6 +24,11 @@
<td>name=Base_createCloneDocument:method</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>name=Base_createCloneDocument:method</td>
<td></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>name=Base_createCloneDocument:method</td>
......
......@@ -19,6 +19,11 @@
<td>//a[@data-i18n="Support Requests"]</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//a[@data-i18n="Support Requests"]</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[@data-i18n="Support Requests"]</td>
......@@ -29,6 +34,11 @@
<td>//div[@role="main"]//div[@data-gadget-url="${base_url}/web_site_module/erp5_officejs_support_request_ui/gadget_erp5_searchfield.html"]//input[@name="search"]</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//div[@role="main"]//div[@data-gadget-url="${base_url}/web_site_module/erp5_officejs_support_request_ui/gadget_erp5_searchfield.html"]//input[@name="search"]</td>
<td></td>
</tr>
<tr>
<td>type</td>
<td>//div[@role="main"]//div[@data-gadget-url="${base_url}/web_site_module/erp5_officejs_support_request_ui/gadget_erp5_searchfield.html"]//input[@name="search"]</td>
......@@ -55,6 +65,11 @@
<td>//div[@class="document_table"]/table/tbody/tr/td[1]/a[contains(text(), "123dsfa")]</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//div[@class="document_table"]/table/tbody/tr/td[1]/a[contains(text(), "123dsfa")]</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//div[@class="document_table"]/table/tbody/tr/td[1]/a[contains(text(), "123dsfa")]</td>
......
......@@ -22,6 +22,11 @@
<td>//input[@data-i18n='[value]Submit New Support Request']</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//input[@data-i18n='[value]Submit New Support Request']</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[@class="document_table"]//tr/td[1]</td>
......
......@@ -25,6 +25,11 @@
<td>//input[@data-i18n='[value]Submit New Support Request']</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//input[@data-i18n='[value]Submit New Support Request']</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[contains(@class, "panel")]//a</td>
......
......@@ -28,11 +28,21 @@
<td>//input[@data-i18n='[value]Submit New Support Request']</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//input[@data-i18n='[value]Submit New Support Request']</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[@class="document_table"]//tr/td[1]</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//div[@class="document_table"]//tr/td[1]</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//div[@class="document_table"]//tr/td[1]/a</td>
......@@ -40,7 +50,6 @@
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_content_loaded" />
<tr>
<td>assertText</td>
<td>//div[contains(@class, "panel")]//a[contains(@class, "ui-icon-home")]</td>
......
......@@ -9,36 +9,55 @@
<tr><td rowspan="1" colspan="3">Support Request Zuite</td></tr>
</thead><tbody>
<tal:block metal:use-macro="here/Zuite_CommonTemplate/macros/init" />
<!-- Clean Up -->
<tr>
<td>open</td>
<td>${base_url}/ERP5Site_addManagerAclUserIfNotExisting</td>
<td>${base_url}/bar_module/ListBoxZuite_reset</td>
<td></td>
</tr>
<tr>
<td>open</td>
<td>${base_url}/web_site_module/erp5_officejs_support_request_ui/</td>
<td>assertTextPresent</td>
<td>Reset Successfully.</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//a[@data-i18n='Logout']</td>
<td>open</td>
<td>${base_url}/ERP5Site_addManagerAclUserIfNotExisting</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplate/macros/wait_for_activities" />
<tr>
<td>click</td>
<td>//a[@data-i18n='Logout']</td>
<td>open</td>
<td>${base_url}/web_site_module/erp5_officejs_support_request_ui/</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_app_loaded" />
<tal:block tal:define="click_configuration python: {'text': 'Logout'}">
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/click_on_panel_link" />
</tal:block>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_content_loaded" />
<tr>
<td>waitForElementPresent</td>
<td>//input[@value='Confirm']</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//input[@value='Confirm']</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//input[@value='Confirm']</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_app_loaded" />
<!-- Use waitForElementPresent command to make sure we are logged out -->
<!-- Then access the homepage to make sure the login form still can appear -->
<tr>
......@@ -46,6 +65,11 @@
<td>//input[@name="WebSite_login:method"]</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//input[@name="WebSite_login:method"]</td>
<td></td>
</tr>
<tr>
<td>open</td>
<td>${base_url}/web_site_module/erp5_officejs_support_request_ui/</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