Commit 225f608b authored by Ivan Tyagov's avatar Ivan Tyagov

erp5_wendelin_tutorial_ui_test: Stablizing fixup

See merge request !97
parents 6beb6c47 489f669a
...@@ -2,26 +2,8 @@ ...@@ -2,26 +2,8 @@
<test> <test>
<table style="display: none;" class="test"> <table style="display: none;" class="test">
<tbody> <tbody>
<tr>
<td>store</td>
<td tal:content="python:here.getPortalObject().absolute_url()">http://example.com/erp5</td>
<td>base_url_x</td>
</tr>
<tr>
<td>openAndWait</td>
<td>${base_url}/Zuite_setUpPersonTest</td>
<td></td>
</tr>
<tr>
<td>verifyTextPresent</td>
<td>Init Ok</td>
<td></td>
</tr>
<tr class="" style="opacity: 1;">
<td colspan="3">&lt;span metal:use-macro="container/Zuite_viewTestMacroLibrary/macros/wait_for_activities"&gt; Wait for activities &lt;/span&gt;</td>
</tr>
<tr class="" style="opacity: 1;"> <tr class="" style="opacity: 1;">
<td colspan="3">&lt;span metal:use-macro="container/Zuite_viewTestMacroLibrary/macros/login_as_functional_test_user"&gt;Login As Functional Test User&lt;/span&gt;</td> <td colspan="3">&lt;span metal:use-macro="container/Zuite_viewWendelinTestMacroLibrary/macros/init_wendelin_test_environment"&gt;Init Wendlin Test Environment&lt;/span&gt;</td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
...@@ -128,7 +110,7 @@ ...@@ -128,7 +110,7 @@
<tbody> <tbody>
<tr> <tr>
<td>openAndWait</td> <td>openAndWait</td>
<td>${base_url_x}/web_site_module/default_wendelin_front/</td> <td>${default_front_url}</td>
<td></td> <td></td>
</tr> </tr>
<tr> <tr>
...@@ -171,8 +153,6 @@ ...@@ -171,8 +153,6 @@
<td>//input[@type="submit" and @value="Create Document"]</td> <td>//input[@type="submit" and @value="Create Document"]</td>
<td></td> <td></td>
</tr> </tr>
<tr> <tr>
<td>waitForElementPresent</td> <td>waitForElementPresent</td>
<td>//input[@id="field_my_title"]</td> <td>//input[@id="field_my_title"]</td>
......
...@@ -2,27 +2,8 @@ ...@@ -2,27 +2,8 @@
<test> <test>
<table style="display: none;" class="test"> <table style="display: none;" class="test">
<tbody> <tbody>
<tr>
<td>store</td>
<td tal:content="python:here.getPortalObject().absolute_url()">http://example.com/erp5</td>
<td>base_url_x</td>
</tr>
<tr>
<td>openAndWait</td>
<td>${base_url}/Zuite_setUpPersonTest</td>
<td></td>
</tr>
</tr>
<td>verifyTextPresent</td>
<td>Init Ok</td>
<td></td>
</tr>
<tr class="" style="opacity: 1;">
<td colspan="3">&lt;span metal:use-macro="container/Zuite_viewTestMacroLibrary/macros/wait_for_activities"&gt; Wait for activities &lt;/span&gt;</td>
</tr>
<tr class="" style="opacity: 1;"> <tr class="" style="opacity: 1;">
<td colspan="3">&lt;span metal:use-macro="container/Zuite_viewTestMacroLibrary/macros/login_as_functional_test_user"&gt;Login As Functional Test User&lt;/span&gt;</td> <td colspan="3">&lt;span metal:use-macro="container/Zuite_viewWendelinTestMacroLibrary/macros/init_wendelin_test_environment"&gt;Init Wendlin Test Environment&lt;/span&gt;</td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
...@@ -131,7 +112,7 @@ ...@@ -131,7 +112,7 @@
<tbody> <tbody>
<tr> <tr>
<td>openAndWait</td> <td>openAndWait</td>
<td>${base_url_x}/web_site_module/default_wendelin_front/</td> <td>${default_front_url}</td>
<td></td> <td></td>
</tr> </tr>
<tr> <tr>
......
...@@ -2,25 +2,8 @@ ...@@ -2,25 +2,8 @@
<test> <test>
<table style="display: none;" class="test"> <table style="display: none;" class="test">
<tbody> <tbody>
<tr>
<td>store</td>
<td tal:content="python:here.getPortalObject().absolute_url()">http://example.com/erp5</td>
<td>base_url_x</td>
</tr>
<tr>
<td>openAndWait</td>
<td>${base_url}/Zuite_setUpPersonTest</td>
<td></td>
</tr>
<tr>
<td>verifyTextPresent</td>
<td></td>
</tr>
<tr class="" style="opacity: 1;">
<td colspan="3">&lt;span metal:use-macro="container/Zuite_viewTestMacroLibrary/macros/wait_for_activities"&gt; Wait for activities &lt;/span&gt;</td>
</tr>
<tr class="" style="opacity: 1;"> <tr class="" style="opacity: 1;">
<td colspan="3">&lt;span metal:use-macro="container/Zuite_viewTestMacroLibrary/macros/login_as_functional_test_user"&gt;Login As Functional Test User&lt;/span&gt;</td> <td colspan="3">&lt;span metal:use-macro="container/Zuite_viewWendelinTestMacroLibrary/macros/init_wendelin_test_environment"&gt;Init Wendlin Test Environment&lt;/span&gt;</td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
...@@ -81,7 +64,7 @@ ...@@ -81,7 +64,7 @@
<tbody> <tbody>
<tr> <tr>
<td>openAndWait</td> <td>openAndWait</td>
<td>${base_url_x}/web_site_module/default_wendelin_front/</td> <td>${default_front_url}</td>
<td></td> <td></td>
</tr> </tr>
<tr> <tr>
...@@ -245,8 +228,6 @@ ...@@ -245,8 +228,6 @@
<td>//li[@name='Organisation']</td> <td>//li[@name='Organisation']</td>
<td></td> <td></td>
</tr> </tr>
<tr> <tr>
<td>type</td> <td>type</td>
<td>//input[@id="field_my_source_section_title"]</td> <td>//input[@id="field_my_source_section_title"]</td>
...@@ -267,7 +248,6 @@ ...@@ -267,7 +248,6 @@
<td>//li[@name='Organisation']</td> <td>//li[@name='Organisation']</td>
<td></td> <td></td>
</tr> </tr>
<tr> <tr>
<td>type</td> <td>type</td>
<td>//input[@id="field_my_destination_title"]</td> <td>//input[@id="field_my_destination_title"]</td>
...@@ -304,9 +284,9 @@ ...@@ -304,9 +284,9 @@
<td></td> <td></td>
</tr> </tr>
<tr> <tr>
<td>pause</td> <td colspan="3">&lt;tal:block
<td>5000</td> metal:use-macro=&quot;here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_content_loaded&quot;&gt;
<td></td> &lt;/tal:block&gt;</td>
</tr> </tr>
<tr> <tr>
<td>waitForElementPresent</td> <td>waitForElementPresent</td>
...@@ -338,19 +318,16 @@ ...@@ -338,19 +318,16 @@
<td>//button[@type="submit" and @class="success"]</td> <td>//button[@type="submit" and @class="success"]</td>
<td></td> <td></td>
</tr> </tr>
<tr> <tr>
<td>waitForElementPresent</td> <td>waitForElementPresent</td>
<td>//label[@for="field_my_translated_validation_state_title"]</td> <td>//label[@for="field_my_translated_validation_state_title"]</td>
<td></td> <td></td>
</tr> </tr>
<tr> <tr>
<td>assertTextPresent</td> <td>assertTextPresent</td>
<td>Validated</td> <td>Validated</td>
<td></td> <td></td>
</tr> </tr>
<tr> <tr>
<td>waitForElementPresent</td> <td>waitForElementPresent</td>
<td>//input[@id="field_my_destination_section_title"]</td> <td>//input[@id="field_my_destination_section_title"]</td>
...@@ -382,9 +359,9 @@ ...@@ -382,9 +359,9 @@
<td></td> <td></td>
</tr> </tr>
<tr> <tr>
<td>pause</td> <td colspan="3">&lt;tal:block
<td>5000</td> metal:use-macro=&quot;here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_content_loaded&quot;&gt;
<td></td> &lt;/tal:block&gt;</td>
</tr> </tr>
<tr> <tr>
<td>waitForElementPresent</td> <td>waitForElementPresent</td>
...@@ -580,9 +557,9 @@ ...@@ -580,9 +557,9 @@
<td></td> <td></td>
</tr> </tr>
<tr> <tr>
<td>pause</td> <td colspan="3">&lt;tal:block
<td>5000</td> metal:use-macro=&quot;here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_content_loaded&quot;&gt;
<td></td> &lt;/tal:block&gt;</td>
</tr> </tr>
<tr> <tr>
<td>waitForElementPresent</td> <td>waitForElementPresent</td>
...@@ -595,9 +572,9 @@ ...@@ -595,9 +572,9 @@
<td></td> <td></td>
</tr> </tr>
<tr> <tr>
<td>pause</td> <td colspan="3">&lt;tal:block
<td>5000</td> metal:use-macro=&quot;here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_content_loaded&quot;&gt;
<td></td> &lt;/tal:block&gt;</td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
...@@ -689,16 +666,16 @@ ...@@ -689,16 +666,16 @@
<td>//input[@type="submit" and @value="Create Document"]</td> <td>//input[@type="submit" and @value="Create Document"]</td>
<td></td> <td></td>
</tr> </tr>
<tr>
<td>pause</td>
<td>5000</td>
<td></td>
</tr>
<tr> <tr>
<td>click</td> <td>click</td>
<td>//input[@type="submit" and @value="Create Document"]</td> <td>//input[@type="submit" and @value="Create Document"]</td>
<td></td> <td></td>
</tr> </tr>
<tr>
<td colspan="3">&lt;tal:block
metal:use-macro=&quot;here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_content_loaded&quot;&gt;
&lt;/tal:block&gt;</td>
</tr>
<tr> <tr>
<td>waitForElementPresent</td> <td>waitForElementPresent</td>
<td>//input[@id="field_my_title"]</td> <td>//input[@id="field_my_title"]</td>
...@@ -745,9 +722,9 @@ ...@@ -745,9 +722,9 @@
<td></td> <td></td>
</tr> </tr>
<tr> <tr>
<td>pause</td> <td colspan="3">&lt;tal:block
<td>5000</td> metal:use-macro=&quot;here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_content_loaded&quot;&gt;
<td></td> &lt;/tal:block&gt;</td>
</tr> </tr>
<tr> <tr>
<td>waitForElementPresent</td> <td>waitForElementPresent</td>
...@@ -760,9 +737,9 @@ ...@@ -760,9 +737,9 @@
<td></td> <td></td>
</tr> </tr>
<tr> <tr>
<td>pause</td> <td colspan="3">&lt;tal:block
<td>5000</td> metal:use-macro=&quot;here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_listbox_loaded&quot;&gt;
<td></td> &lt;/tal:block&gt;</td>
</tr> </tr>
<tr> <tr>
<td>verifyElementPresent</td> <td>verifyElementPresent</td>
...@@ -786,7 +763,7 @@ ...@@ -786,7 +763,7 @@
</tr> </tr>
<tr> <tr>
<td>open</td> <td>open</td>
<td>${base_url_x}/portal_skins/erp5_wendelin_data_lake/Ingestion_ingestDataStream?reference=sensor_1-sample-environment-raw-data</td> <td>${base_url}/Ingestion_ingestDataStream?reference=sensor_1-sample-environment-raw-data</td>
<td></td> <td></td>
</tr> </tr>
<tr> <tr>
...@@ -794,16 +771,6 @@ ...@@ -794,16 +771,6 @@
<td>Data ingested</td> <td>Data ingested</td>
<td></td> <td></td>
</tr> </tr>
<tr>
<td>pause</td>
<td>60000</td>
<td></td>
</tr>
<tr>
<td>openAndWait</td>
<td>${base_url_x}/web_site_module/default_wendelin_front/</td>
<td></td>
</tr>
</tbody> </tbody>
</table> </table>
</test> </test>
......
...@@ -2,25 +2,8 @@ ...@@ -2,25 +2,8 @@
<test> <test>
<table style="display: none;" class="test"> <table style="display: none;" class="test">
<tbody> <tbody>
<tr>
<td>store</td>
<td tal:content="python:here.getPortalObject().absolute_url()">http://example.com/erp5</td>
<td>base_url_x</td>
</tr>
<tr>
<td>openAndWait</td>
<td>${base_url}/Zuite_setUpPersonTest</td>
<td></td>
</tr>
<tr>
<td>verifyTextPresent</td>
<td></td>
</tr>
<tr class="" style="opacity: 1;">
<td colspan="3">&lt;span metal:use-macro="container/Zuite_viewTestMacroLibrary/macros/wait_for_activities"&gt; Wait for activities &lt;/span&gt;</td>
</tr>
<tr class="" style="opacity: 1;"> <tr class="" style="opacity: 1;">
<td colspan="3">&lt;span metal:use-macro="container/Zuite_viewTestMacroLibrary/macros/login_as_functional_test_user"&gt;Login As Functional Test User&lt;/span&gt;</td> <td colspan="3">&lt;span metal:use-macro="container/Zuite_viewWendelinTestMacroLibrary/macros/init_wendelin_test_environment"&gt;Init Wendlin Test Environment&lt;/span&gt;</td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
...@@ -123,7 +106,7 @@ ...@@ -123,7 +106,7 @@
</tr> </tr>
<tr> <tr>
<td>openAndWait</td> <td>openAndWait</td>
<td>${base_url_x}/web_site_module/default_wendelin_front/</td> <td>${default_front_url}</td>
<td></td> <td></td>
</tr> </tr>
<tr> <tr>
......
...@@ -2,123 +2,14 @@ ...@@ -2,123 +2,14 @@
<test> <test>
<table style="display: none;" class="test"> <table style="display: none;" class="test">
<tbody> <tbody>
<tr> <tr class="" style="opacity: 1;">
<td>store</td> <td colspan="3">&lt;span metal:use-macro="container/Zuite_viewWendelinTestMacroLibrary/macros/init_wendelin_test_environment"&gt;Init Wendlin Test Environment&lt;/span&gt;</td>
<td tal:content="python:here.getPortalObject().absolute_url()">http://example.com/erp5</td>
<td>base_url_x</td>
</tr>
<tr>
<td>openAndWait</td>
<td>${base_url}/Zuite_createFunctionalTestUserForTutorial</td>
<td></td>
</tr>
<tr>
<td>assertTextPresent</td>
<td>Done.</td>
<td></td>
</tr>
<tr>
<td>openAndWait</td>
<td>${base_url}/Zuite_waitForActivities</td>
<td></td>
</tr>
<tr>
<td>assertTextPresent</td>
<td>Done.</td>
<td></td>
</tr>
<tr>
<td>openAndWait</td>
<td>${base_url}/Base_clearCache</td>
<td></td>
</tr>
<tr>
<td>assertTextPresent</td>
<td>Cleared.</td>
<td></td>
</tr>
<!-- login with functional test user -->
<tr>
<td>openAndWait</td>
<td>${base_url}/logout</td>
<td></td>
</tr>
<tr>
<td>openAndWait</td>
<td>${base_url}/login_form</td>
<td></td>
</tr>
<tr>
<td>type</td>
<td>//input[@name="__ac_name"]</td>
<td>functional_test_tutorial_username</td>
</tr>
<tr>
<td>type</td>
<td>//input[@name="__ac_password"]</td>
<td>secret</td>
</tr>
<tr>
<td>clickAndWait</td>
<td>//input[@name="logged_in:method"]</td>
<td></td>
</tr>
<tr>
<td>openAndWait</td>
<td>${base_url}/view</td>
<td></td>
</tr>
<tr>
<td>assertTextPresent</td>
<td>functional_test_tutorial_username</td>
<td></td>
</tr>
<tr>
<td>openAndWait</td>
<td>${base_url}/Zuite_waitForActivities</td>
<td></td>
</tr>
<tr>
<td>assertTextPresent</td>
<td>Done.</td>
<td></td>
</tr>
<tr>
<td>openAndWait</td>
<td>${base_url}/Base_clearCache</td>
<td></td>
</tr>
<tr>
<td>assertTextPresent</td>
<td>Cleared.</td>
<td></td>
</tr>
<tr>
<td>openAndWait</td>
<td>${base_url}/Zuite_updateUserPreference</td>
<td></td>
</tr>
<tr>
<td>assertTextPresent</td>
<td>Init Ok.</td>
<td></td>
</tr>
<tr>
<td>openAndWait</td>
<td>${base_url}/view</td>
<td></td>
</tr> </tr>
<tr> <tr>
<td>openAndWait</td> <td>openAndWait</td>
<td>${base_url}/Zuite_updateUserPreferenceForTutorialTests</td> <td>${base_url}/Zuite_updateUserPreferenceForTutorialTests</td>
<td></td> <td></td>
</tr> </tr>
<tr>
<td>assertTextPresent</td>
<td>Init Ok.</td>
<td></td>
</tr>
</tbody> </tbody>
</table> </table>
</test> </test>
...@@ -429,23 +320,17 @@ plot();</code> ...@@ -429,23 +320,17 @@ plot();</code>
<tbody> <tbody>
<tr> <tr>
<td>openAndWait</td> <td>openAndWait</td>
<td>${base_url_x}/web_site_module/default_wendelin_front/</td> <td>${default_front_url}</td>
<td></td> <td></td>
</tr> </tr>
<tr> <tr class="" style="opacity: 1;">
<td>waitForElementPresent</td> <td colspan="3">&lt;span metal:use-macro="container/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_app_loaded"&gt;&lt;/span&gt;</td>
<td>//a[contains(@href,'page=front')]</td>
<td></td>
</tr> </tr>
<tr> <tr>
<td>click</td> <td colspan="3">&lt;tal:block tal:define=&quot;click_configuration python: {&#39;text&#39;: &#39;Modules&#39;}&quot;&gt; &lt;tal:block metal:use-macro=&quot;here/Zuite_CommonTemplateForRenderjsUi/macros/click_on_panel_link&quot;&gt; &lt;/tal:block&gt; &lt;/tal:block&gt;</td>
<td>//a[contains(@href,'page=front')]</td>
<td></td>
</tr> </tr>
<tr> <tr>
<td>pause</td> <td colspan="3">&lt;tal:block metal:use-macro=&quot;here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_content_loaded&quot;&gt; &lt;/tal:block&gt;</td>
<td>5000</td>
<td></td>
</tr> </tr>
<tr> <tr>
<td>waitForElementPresent</td> <td>waitForElementPresent</td>
...@@ -457,6 +342,11 @@ plot();</code> ...@@ -457,6 +342,11 @@ plot();</code>
<td>//a[contains(@href,'key=notebook_module')]</td> <td>//a[contains(@href,'key=notebook_module')]</td>
<td></td> <td></td>
</tr> </tr>
<tr>
<td colspan="3">&lt;tal:block
metal:use-macro=&quot;here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_content_loaded&quot;&gt;
&lt;/tal:block&gt;</td>
</tr>
<tr> <tr>
<td>waitForElementPresent</td> <td>waitForElementPresent</td>
<td>//a[@data-i18n="Add"]</td> <td>//a[@data-i18n="Add"]</td>
...@@ -468,13 +358,13 @@ plot();</code> ...@@ -468,13 +358,13 @@ plot();</code>
<td></td> <td></td>
</tr> </tr>
<tr> <tr>
<td>waitForElementPresent</td> <td colspan="3">&lt;tal:block
<td>//input[@type="submit" and @value="Create Document"]</td> metal:use-macro=&quot;here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_content_loaded&quot;&gt;
<td></td> &lt;/tal:block&gt;</td>
</tr> </tr>
<tr> <tr>
<td>pause</td> <td>waitForElementPresent</td>
<td>3000</td> <td>//input[@type="submit" and @value="Create Document"]</td>
<td></td> <td></td>
</tr> </tr>
<tr> <tr>
...@@ -483,21 +373,10 @@ plot();</code> ...@@ -483,21 +373,10 @@ plot();</code>
<td></td> <td></td>
</tr> </tr>
<tr> <tr>
<td>pause</td> <td colspan="3">&lt;tal:block
<td>3000</td> metal:use-macro=&quot;here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_content_loaded&quot;&gt;
<td></td> &lt;/tal:block&gt;</td>
</tr> </tr>
<tr>
<td>waitForElementPresent</td>
<td>//input[@id="editable"]</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//input[@id="editable"]</td>
<td></td>
</tr>
<tr> <tr>
<td>waitForElementPresent</td> <td>waitForElementPresent</td>
<td>//a[text()='Edit']</td> <td>//a[text()='Edit']</td>
...@@ -508,13 +387,11 @@ plot();</code> ...@@ -508,13 +387,11 @@ plot();</code>
<td>//a[text()='Edit']</td> <td>//a[text()='Edit']</td>
<td></td> <td></td>
</tr> </tr>
<tr> <tr>
<td>waitForElementPresent</td> <td>waitForElementPresent</td>
<td>//input[@id="field_my_title"]</td> <td>//input[@id="field_my_title"]</td>
<td></td> <td></td>
</tr> </tr>
<tr> <tr>
<td>type</td> <td>type</td>
<td>//input[@id="field_my_title"]</td> <td>//input[@id="field_my_title"]</td>
...@@ -543,7 +420,7 @@ js: https://cdn.plot.ly/plotly-latest.min.js ...@@ -543,7 +420,7 @@ js: https://cdn.plot.ly/plotly-latest.min.js
%% js %% js
hateoas_url = &quot;${base_url_x}/web_site_module/renderjs_runner/hateoas/&quot;; hateoas_url = &quot;${base_url}/web_site_module/renderjs_runner/hateoas/&quot;;
jio = jIO.createJIO({ jio = jIO.createJIO({
&nbsp; type: &quot;erp5&quot;, &nbsp; type: &quot;erp5&quot;,
&nbsp; url: hateoas_url, &nbsp; url: hateoas_url,
...@@ -747,9 +624,9 @@ plot(); ...@@ -747,9 +624,9 @@ plot();
<td></td> <td></td>
</tr> </tr>
<tr> <tr>
<td>pause</td> <td colspan="3">&lt;tal:block
<td>3000</td> metal:use-macro=&quot;here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_content_loaded&quot;&gt;
<td></td> &lt;/tal:block&gt;</td>
</tr> </tr>
<tr> <tr>
<td>waitForElementPresent</td> <td>waitForElementPresent</td>
...@@ -762,12 +639,12 @@ plot(); ...@@ -762,12 +639,12 @@ plot();
<td></td> <td></td>
</tr> </tr>
<tr> <tr>
<td>pause</td> <td colspan="3">&lt;tal:block
<td>20000</td> metal:use-macro=&quot;here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_content_loaded&quot;&gt;
<td></td> &lt;/tal:block&gt;</td>
</tr> </tr>
<tr> <tr>
<td>assertElementPresent</td> <td>waitForElementPresent</td>
<td>//div[@id="plot_div"]</td> <td>//div[@id="plot_div"]</td>
<td></td> <td></td>
</tr> </tr>
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
portal = context.getPortalObject() portal = context.getPortalObject()
howto_dict = context.Zuite_getHowToInfo() howto_dict = context.Zuite_getHowToInfo()
functional_test_username = 'functional_test_tutorial_username' functional_test_username = howto_dict['functional_test_username']
person = getattr(portal.person_module, functional_test_username, None) person = getattr(portal.person_module, functional_test_username, None)
if person is None: if person is None:
person = portal.person_module.newContent(portal_type='Person', person = portal.person_module.newContent(portal_type='Person',
...@@ -25,12 +25,18 @@ if person is None: ...@@ -25,12 +25,18 @@ if person is None:
login = person.newContent( login = person.newContent(
portal_type='ERP5 Login', portal_type='ERP5 Login',
reference=functional_test_username, reference=functional_test_username,
password='secret', password=howto_dict['functional_test_user_password'],
) )
login.validate() login.validate()
# XXX (lucas): These tests must be able to run on an instance without security. # XXX (lucas): These tests must be able to run on an instance without security.
for role in ('Manager','Assignee', 'Assignor', 'Associate', 'Auditor', 'Owner'): # BBB for PAS 1.9.0 we pass a response and undo the redirect
portal.acl_users.zodb_roles.assignRoleToPrincipal(role, person.Person_getUserId()) response = container.REQUEST.RESPONSE
for role in ('Manager', 'Assignee', 'Assignor', 'Associate', 'Auditor', 'Owner'):
portal.acl_users.zodb_roles.manage_assignRoleToPrincipals(
role,
(person.Person_getUserId(),),
RESPONSE=response)
response.setStatus(200)
return 'Done.' return 'Done.'
portal = context.getPortalObject()
dataAnalysisLine = context.portal_catalog.getResultValue(portal_type='Python Script',
title="DataAnalysisLine_convertEnvironmentDataStreamToArray")
if dataAnalysisLine is not None:
portal.portal_callables.deleteContent(dataAnalysisLine.getId())
return "Init ok."
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>Script_magic</string> </key>
<value> <int>3</int> </value>
</item>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_container</string> </key>
<value> <string>container</string> </value>
</item>
<item>
<key> <string>name_context</string> </key>
<value> <string>context</string> </value>
</item>
<item>
<key> <string>name_m_self</string> </key>
<value> <string>script</string> </value>
</item>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>_proxy_roles</string> </key>
<value>
<tuple>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Zuite_transformDataSetup</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
preference_tool = context.getPortalObject().portal_preferences preference_tool = context.getPortalObject().portal_preferences
preference = preference_tool.getActivePreference() preference = preference_tool.getActiveUserPreference()
if preference is not None: # XXX: 3 is Priority.USER if preference is not None: # XXX: 3 is Priority.USER
preference.setPreferredTextEditor('text_area') preference.setPreferredTextEditor('text_area')
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ZopePageTemplate" module="Products.PageTemplates.ZopePageTemplate"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>text/html</string> </value>
</item>
<item>
<key> <string>expand</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Zuite_viewWendelinTestMacroLibrary</string> </value>
</item>
<item>
<key> <string>output_encoding</string> </key>
<value> <string>utf-8</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <unicode></unicode> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<tal:block metal:define-macro="init_wendelin_test_environment">
<tr>
<td>store</td>
<td tal:content="python:here.getPortalObject().absolute_url()"></td>
<td>base_url</td>
</tr>
<tr>
<td>store</td>
<td tal:content="python:here.getPortalObject().absolute_url() + '/web_site_module/default_wendelin_data_lake/'"></td>
<td>wendelin_data_lake_url</td>
</tr>
<tr>
<td>store</td>
<td tal:content="python:here.getPortalObject().absolute_url() + '/web_site_module/default_wendelin_front/'"></td>
<td>default_front_url</td>
</tr>
<tr>
<td>openAndWait</td>
<td>${base_url}/Zuite_setUpPersonTest</td>
<td></td>
</tr>
<tr>
<td>verifyTextPresent</td>
<td>Init Ok</td>
<td></td>
</tr>
<tr class="" style="opacity: 1;">
<td colspan="3"><span metal:use-macro="container/Zuite_viewTestMacroLibrary/macros/wait_for_activities"> Wait for activities </span></td>
</tr>
<tr class="" style="opacity: 1;">
<td colspan="3"><span metal:use-macro="container/Zuite_viewWendelinTestMacroLibrary/macros/login_as_functional_test_user">Login As Functional Test User</span></td>
</tr>
</tal:block>
<tal:block metal:define-macro="login_as_functional_test_user">
<tr>
<td colspan="3"><b>Login as functional test user</b></td>
</tr>
<tr>
<td>openAndWait</td>
<td>${base_url}/Zuite_createFunctionalTestUserForTutorial</td>
<td></td>
</tr>
<tr>
<td>assertTextPresent</td>
<td>Done.</td>
<td></td>
</tr>
<span metal:use-macro="container/Zuite_viewTestMacroLibrary/macros/wait_for_activities"> Wait for activities</span>
<tr>
<td>openAndWait</td>
<td>${base_url}/Base_clearCache</td>
<td></td>
</tr>
<tr>
<td>assertTextPresent</td>
<td>Cleared.</td>
<td></td>
</tr>
<tr>
<td>open</td>
<td>${wendelin_data_lake_url}</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_app_loaded" />
<!-- login with functional test user -->
<span metal:use-macro="container/Zuite_viewWendelinTestMacroLibrary/macros/logout">Logout</span>
<tr>
<td>click</td>
<td>//a[@data-i18n="Login"]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//input[@name="__ac_name"]</td>
<td></td>
</tr>
<tr>
<td>type</td>
<td>//input[@name="__ac_name"]</td>
<td tal:content="python:
here.Zuite_getHowToInfo()['functional_test_username']"></td>
</tr>
<tr>
<td>type</td>
<td>//input[@name="__ac_password"]</td>
<td tal:content="python:
here.Zuite_getHowToInfo()['functional_test_user_password']"></td>
</tr>
<tr>
<td>click</td>
<td>//input[@value="Login"]</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_app_loaded" />
<span metal:use-macro="container/Zuite_viewTestMacroLibrary/macros/wait_for_activities"> Wait for activities</span>
<tr>
<td>openAndWait</td>
<td>${base_url}/Base_clearCache</td>
<td></td>
</tr>
<tr>
<td>assertTextPresent</td>
<td>Cleared.</td>
<td></td>
</tr>
<tr>
<td>openAndWait</td>
<td>${base_url}/Zuite_updateUserPreferenceForTutorialTests</td>
<td></td>
</tr>
<tr>
<td>assertTextPresent</td>
<td>Init Ok.</td>
<td></td>
</tr>
<span metal:use-macro="container/Zuite_viewTestMacroLibrary/macros/wait_for_activities"> Wait for activities</span>
<tr>
<td>openAndWait</td>
<td>${wendelin_data_lake_url}</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_app_loaded" />
</tal:block>
<tal:block metal:define-macro="logout">
<tr>
<td colspan="3"><b>Logout</b></td>
</tr>
<!-- Logout -->
<tr>
<td>open</td>
<td>${wendelin_data_lake_url}</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>
<tr>
<td>waitForElementPresent</td>
<td>//h1/a[@data-i18n="Logout"]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</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" />
</tal:block>
\ No newline at end of file
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