Commit 4395808d authored by Romain Courteaud's avatar Romain Courteaud

slapos_panel_ui_test:

* add Software Product to create Subscription Request
* add Sale Supply for virtual master
* fixup to generate subscription request and use the instance parameter editor
* fixup Instance editor usage
* set reference on the Trade Condition
* fix consistency of other documents before running the tests
parent 3ffa40ad
...@@ -40,7 +40,10 @@ def ERP5Site_bootstrapSlapOSPanelTest(self, step, scenario, customer_login, ...@@ -40,7 +40,10 @@ def ERP5Site_bootstrapSlapOSPanelTest(self, step, scenario, customer_login,
sm = getSecurityManager() sm = getSecurityManager()
try: try:
newSecurityManager(None, portal.acl_users.getUser(SUPER_USER)) newSecurityManager(None, portal.acl_users.getUser(SUPER_USER))
self.testromain()
# Ensure checkConsistency is OK on the website installed by ui_test bt5
portal.portal_alarms.upgrader_check_post_upgrade.activeSense(
fixit=True)
# Organisation # Organisation
organisation = portal.organisation_module.newContent( organisation = portal.organisation_module.newContent(
...@@ -57,7 +60,7 @@ def ERP5Site_bootstrapSlapOSPanelTest(self, step, scenario, customer_login, ...@@ -57,7 +60,7 @@ def ERP5Site_bootstrapSlapOSPanelTest(self, step, scenario, customer_login,
# Sale trade condition # Sale trade condition
trade_condition = portal.sale_trade_condition_module.newContent( trade_condition = portal.sale_trade_condition_module.newContent(
portal_type="Sale Trade Condition", portal_type="Sale Trade Condition",
title="Test currency", reference="Test currency",
price_currency_value=currency, price_currency_value=currency,
source_value=organisation, source_value=organisation,
#source_section_value=organisation, #source_section_value=organisation,
...@@ -65,6 +68,21 @@ def ERP5Site_bootstrapSlapOSPanelTest(self, step, scenario, customer_login, ...@@ -65,6 +68,21 @@ def ERP5Site_bootstrapSlapOSPanelTest(self, step, scenario, customer_login,
specialise='business_process_module/slapos_ultimate_business_process', specialise='business_process_module/slapos_ultimate_business_process',
) )
trade_condition.validate() trade_condition.validate()
if scenario == 'accounting':
# Sale trade condition
sale_supply = portal.sale_supply_module.newContent(
portal_type="Sale Supply",
title="Test project",
price_currency_value=currency,
)
sale_supply.newContent(
portal_type="Sale Supply Line",
base_price=24,
resource="service_module/slapos_virtual_master_subscription"
)
sale_supply.validate()
finally: finally:
setSecurityManager(sm) setSecurityManager(sm)
...@@ -142,6 +160,17 @@ def ERP5Site_bootstrapSlapOSPanelTest(self, step, scenario, customer_login, ...@@ -142,6 +160,17 @@ def ERP5Site_bootstrapSlapOSPanelTest(self, step, scenario, customer_login,
function='customer' function='customer'
).open() ).open()
# Ensure checkConsistency is OK on this preference
preference = portal.portal_preferences.slapos_default_system_preference
preference.edit(
preferred_hateoas_url='.',
preferred_subscription_assignment_category_list=[
'function/customer',
'role/client',
'destination_project/%s' % project.getRelativeUrl()
]
)
if scenario == 'customer_shared': if scenario == 'customer_shared':
# XXX For shared instance, user must also be a customer # XXX For shared instance, user must also be a customer
# How to create Instance Node without any user related document? # How to create Instance Node without any user related document?
...@@ -162,7 +191,7 @@ def ERP5Site_bootstrapSlapOSPanelTest(self, step, scenario, customer_login, ...@@ -162,7 +191,7 @@ def ERP5Site_bootstrapSlapOSPanelTest(self, step, scenario, customer_login,
customer_person.newContent( customer_person.newContent(
portal_type='Assignment', portal_type='Assignment',
title='Manager for project %s' % project.getTitle(), title='Manager for project %s' % project.getTitle(),
destination_project_value=project, destination_project_value=remote_project,
function='production/manager' function='production/manager'
).open() ).open()
remote_customer_person.newContent( remote_customer_person.newContent(
......
...@@ -27,6 +27,53 @@ ...@@ -27,6 +27,53 @@
<tal:block tal:define="login_configuration python: {'user': user_configuration['manager_login'], 'password': user_configuration['passwd']}">
<tal:block metal:use-macro="here/Zuite_SlapOSPanelTemplate/macros/login" />
</tal:block>
<tr>
<td colspan="3"><b>Go to the project page</b></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_listbox_loaded" />
<tal:block tal:define="click_configuration python: {'text': 'Test Project'}">
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/click_on_page_link" />
</tal:block>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_content_loaded" />
<tr>
<td colspan="3"><b>Add a software product</b></td>
</tr>
<tal:block tal:define="click_configuration python: {'text': 'Add Software Product'}">
<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[@name='field_your_product_import_json']</td>
<td></td>
</tr>
<tr>
<td>type</td>
<td>//input[@name='field_your_product_import_json']</td>
<td>https://lab.nexedi.com/nexedi/slapos/raw/1.0.289/software/theia/software.cfg</td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/submit_dialog" />
<tal:block tal:define="notification_configuration python: {'class': 'success',
'text': 'New Software Product created.'}">
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_notification" />
</tal:block>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_content_loaded" />
<tal:block metal:use-macro="here/Zuite_SlapOSPanelTemplate/macros/wait_for_activities" />
<tal:block metal:use-macro="here/Zuite_SlapOSPanelTemplate/macros/logout" />
<tal:block tal:define="login_configuration python: {'user': user_configuration['customer_login'], 'password': user_configuration['passwd']}"> <tal:block tal:define="login_configuration python: {'user': user_configuration['customer_login'], 'password': user_configuration['passwd']}">
<tal:block metal:use-macro="here/Zuite_SlapOSPanelTemplate/macros/login" /> <tal:block metal:use-macro="here/Zuite_SlapOSPanelTemplate/macros/login" />
</tal:block> </tal:block>
......
...@@ -27,6 +27,53 @@ ...@@ -27,6 +27,53 @@
<tal:block tal:define="login_configuration python: {'user': user_configuration['manager_login'], 'password': user_configuration['passwd']}">
<tal:block metal:use-macro="here/Zuite_SlapOSPanelTemplate/macros/login" />
</tal:block>
<tr>
<td colspan="3"><b>Go to the project page</b></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_listbox_loaded" />
<tal:block tal:define="click_configuration python: {'text': 'Test Project'}">
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/click_on_page_link" />
</tal:block>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_content_loaded" />
<tr>
<td colspan="3"><b>Add a software product</b></td>
</tr>
<tal:block tal:define="click_configuration python: {'text': 'Add Software Product'}">
<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[@name='field_your_product_import_json']</td>
<td></td>
</tr>
<tr>
<td>type</td>
<td>//input[@name='field_your_product_import_json']</td>
<td>https://lab.nexedi.com/nexedi/slapos/raw/1.0.289/software/caddy-frontend/software.cfg</td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/submit_dialog" />
<tal:block tal:define="notification_configuration python: {'class': 'success',
'text': 'New Software Product created.'}">
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_notification" />
</tal:block>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_content_loaded" />
<tal:block metal:use-macro="here/Zuite_SlapOSPanelTemplate/macros/wait_for_activities" />
<tal:block metal:use-macro="here/Zuite_SlapOSPanelTemplate/macros/logout" />
<tal:block tal:define="login_configuration python: {'user': user_configuration['customer_login'], 'password': user_configuration['passwd']}"> <tal:block tal:define="login_configuration python: {'user': user_configuration['customer_login'], 'password': user_configuration['passwd']}">
<tal:block metal:use-macro="here/Zuite_SlapOSPanelTemplate/macros/login" /> <tal:block metal:use-macro="here/Zuite_SlapOSPanelTemplate/macros/login" />
</tal:block> </tal:block>
...@@ -224,6 +271,16 @@ ...@@ -224,6 +271,16 @@
</tal:block> </tal:block>
<!--tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_content_loaded" /--> <!--tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_content_loaded" /-->
<!-- XXX TODO gadget crash if not fully loaded. Remove next wait, and fix gadget --> <!-- XXX TODO gadget crash if not fully loaded. Remove next wait, and fix gadget -->
<tr>
<td>waitForElementPresent</td>
<td>//input[@name='//domain']</td>
<td></td>
</tr>
<tr>
<td>select</td>
<td>//select[@name='software_type']</td>
<td>Custom Personal (Slave)</td>
</tr>
<tr> <tr>
<td>waitForElementPresent</td> <td>waitForElementPresent</td>
<td>//input[@name='//custom_domain']</td> <td>//input[@name='//custom_domain']</td>
...@@ -234,11 +291,6 @@ ...@@ -234,11 +291,6 @@
<td>//input[@name='field_your_title']</td> <td>//input[@name='field_your_title']</td>
<td>Test instance</td> <td>Test instance</td>
</tr> </tr>
<tr>
<td>select</td>
<td>//select[@name='software_type']</td>
<td>Custom Personal (Slave)</td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/submit_dialog" /> <tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/submit_dialog" />
<tal:block tal:define="notification_configuration python: {'class': 'success', <tal:block tal:define="notification_configuration python: {'class': 'success',
'text': 'Action succeeded.'}"> 'text': 'Action succeeded.'}">
......
...@@ -11,9 +11,13 @@ ...@@ -11,9 +11,13 @@
<value> <value>
<object> <object>
<klass> <klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/> <global name="_reconstructor" module="copy_reg"/>
</klass> </klass>
<tuple/> <tuple>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
<global name="object" module="__builtin__"/>
<none/>
</tuple>
<state> <state>
<dictionary> <dictionary>
<item> <item>
......
...@@ -264,7 +264,7 @@ ...@@ -264,7 +264,7 @@
<!-- XXX TODO gadget crash if not fully loaded. Remove next wait, and fix gadget --> <!-- XXX TODO gadget crash if not fully loaded. Remove next wait, and fix gadget -->
<tr> <tr>
<td>waitForElementPresent</td> <td>waitForElementPresent</td>
<td>//input[@name='//custom_domain']</td> <td>//input[@name='//domain']</td>
<td></td> <td></td>
</tr> </tr>
<tr> <tr>
...@@ -286,6 +286,14 @@ ...@@ -286,6 +286,14 @@
<tr>
<td colspan="3"><b>Generate the Subscription Request, and the Software Instance</b></td>
</tr>
<tal:block metal:use-macro="here/Zuite_SlapOSPanelTemplate/macros/wait_for_activities" />
<tr> <tr>
<td colspan="3"><b>Add an Instance Node</b></td> <td colspan="3"><b>Add an Instance Node</b></td>
</tr> </tr>
...@@ -405,6 +413,16 @@ ...@@ -405,6 +413,16 @@
</tal:block> </tal:block>
<!--tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_content_loaded" /--> <!--tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_content_loaded" /-->
<!-- XXX TODO gadget crash if not fully loaded. Remove next wait, and fix gadget --> <!-- XXX TODO gadget crash if not fully loaded. Remove next wait, and fix gadget -->
<tr>
<td>waitForElementPresent</td>
<td>//input[@name='//domain']</td>
<td></td>
</tr>
<tr>
<td>select</td>
<td>//select[@name='software_type']</td>
<td>Custom Personal (Slave)</td>
</tr>
<tr> <tr>
<td>waitForElementPresent</td> <td>waitForElementPresent</td>
<td>//input[@name='//custom_domain']</td> <td>//input[@name='//custom_domain']</td>
...@@ -415,11 +433,6 @@ ...@@ -415,11 +433,6 @@
<td>//input[@name='field_your_title']</td> <td>//input[@name='field_your_title']</td>
<td>Test shared instance</td> <td>Test shared instance</td>
</tr> </tr>
<tr>
<td>select</td>
<td>//select[@name='software_type']</td>
<td>Custom Personal (Slave)</td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/submit_dialog" /> <tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/submit_dialog" />
<tal:block tal:define="notification_configuration python: {'class': 'success', <tal:block tal:define="notification_configuration python: {'class': 'success',
'text': 'Action succeeded.'}"> 'text': 'Action succeeded.'}">
......
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