Commit abdde8bd authored by Rafael Monnerat's avatar Rafael Monnerat

slapos_jio_ui_test: Added tests for required fields on Parameter editor (XML)

  Add samples for required on editor parameter (for tests)
parent 809d891e
{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"description": "Sample paremeters for a Simple Demo with required",
"required": [
"simple-string",
"simple-string-with-enum",
"simple-boolean",
"simple-string-with-text-area",
"simple-integer",
"simple-integer-with-enum",
"simple-numeric-integer",
"simple-numeric-integer-enum",
"simple-numeric-float",
"simple-numeric-float-enum"
],
"properties": {
"simple-string": {
"title": "Example of Simple String",
"description": "Example of Simple String",
"type": "string",
"default": "Simple string "
},
"simple-string-with-enum": {
"title": "Example of Simple String with enum",
"description": "Example of Simple String with enum",
"type": "string",
"enum" : [
"simple string A",
"simple string B",
"simple string C"
],
"default": "simple string A"
},
"simple-boolean": {
"title": "Example of Simple String",
"description": "Example of Simple String",
"type": "boolean",
"default": true
},
"simple-string-with-text-area": {
"title": "Example of Simple String with textarea",
"description": "Example of Simple String with text area",
"type": "string",
"default": "Simple string",
"textarea": true
},
"simple-integer": {
"title": "Example of Simple Integer",
"description": "Example of Simple Integer",
"type": "integer",
"default": 1
},
"simple-integer-with-enum": {
"title": "Example of Simple Integer with enum",
"description": "Example of Simple Integer with enum",
"type": "integer",
"default": 1,
"enum": [
1,
2,
3,
5,
7,
11,
13,
17
]
},
"simple-numeric-integer": {
"title": "Example of Simple Numeric as integer",
"description": "Example of Simple Numeric as Interger",
"type": "number",
"default": 1.0
},
"simple-numeric-integer-enum": {
"title": "Example of Simple Numeric as integer",
"description": "Example of Simple Numeric as Interger",
"type": "number",
"default": 1.0,
"enum": [
1.0,
2.0,
3.0,
5.0,
7.0,
11.0,
13.0,
17.0
]
},
"simple-numeric-float": {
"title": "Example of Simple Numeric as float",
"description": "Example of Simple Numeric as float",
"type": "number",
"default": 1.5
},
"simple-numeric-float-enum": {
"title": "Example of Simple Numeric as float",
"description": "Example of Simple Numeric as float",
"type": "number",
"default": 1.5,
"enum": [
0.25,
0.75,
1.25,
1.5
]
}
}
}
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="File" module="OFS.Image"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>__name__</string> </key>
<value> <string>instance-input-schema-required.json</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>text/x-json</string> </value>
</item>
<item>
<key> <string>precondition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -9,6 +9,13 @@
"request": "instance-input-schema.json",
"response": "instance-output-schema.json",
"index": 0
},
"default-required": {
"title": "Required Example",
"description": "Default reference parameters with required",
"request": "instance-input-schema-required.json",
"response": "instance-output-schema.json",
"index": 0
}
}
}
<?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>testSlapOSJSTestParameterEditorXMLRequired</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>
<html xmlns:tal="http://xml.zope.org/namespaces/tal" xmlns:metal="http://xml.zope.org/namespaces/metal">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Test Parameter editor (XML Serialisation with Required) </title>
</head>
<body>
<table cellpadding="1" cellspacing="1" border="1">
<thead>
<tr>
<td rowspan="1" colspan="3">Test Parameter editor (XML Serialisation with Required)</td>
</tr>
</thead>
<tbody>
<tal:block metal:use-macro="here/Zuite_CommonTemplate/macros/init" />
<tal:block metal:use-macro="here/Zuite_CommonTemplate/macros/wait_for_activities" />
<tr>
<td>open</td>
<td>${base_url}/web_site_module/hostingjs/#/?page=slap_test_parameter_form</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/wait_for_app_loaded" />
<tr>
<td>waitForElementPresent</td>
<td>//input[@name='url_string']</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//input[@name='url_string']</td>
<td></td>
</tr>
<tr>
<td colspan="3"><b> Set URL for the software release </b></td>
</tr>
<tr>
<td>type</td>
<td>//input[@name='url_string']</td>
<td>${base_url}/web_site_module/hostingjs/hateoas/sample-software-schema/minimal_xml_demo/software.cfg</td>
</tr>
<tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/click_proceed" />
<tr>
<td colspan="3"><b> Wait for software type </b></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[contains(@data-gadget-url,
'gadget_erp5_page_slap_parameter_form.html')]//select[@name="software_type"]</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//div[contains(@data-gadget-url,
'gadget_erp5_page_slap_parameter_form.html')]//select[@name="software_type"]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[contains(@data-gadget-url,
'gadget_erp5_page_slap_parameter_form.html')]//select[@name="software_type"]//option[text()="Required Example"]
</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//div[contains(@data-gadget-url,
'gadget_erp5_page_slap_parameter_form.html')]//select[@name="software_type"]//option[text()="Required Example"]
</td>
<td></td>
</tr>
<tr>
<td>select</td>
<td>//div[contains(@data-gadget-url,
'gadget_erp5_page_slap_parameter_form.html')]//select[@name="software_type"]</td>
<td>Required Example</td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//input[@name="//simple-string" and @type="text"]</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//input[@name="//simple-string" and @type="text"]</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//input[@name="//simple-string" and @type="text"]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//select[@name="//simple-string-with-enum"]</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//select[@name="//simple-string-with-enum"]</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//select[@name="//simple-string-with-enum"]</td>
<td></td>
</tr>
<tr>
<td colspan="3"><b> Assert Error Messages</b></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//span[@class="error" and text() = 'Instance does not have required property "simple-string".']</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//span[@class="error" and text() = 'Instance does not have required property "simple-string".']</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//span[@class="error" and text() = 'Instance does not have required property "simple-string-with-enum".']</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//span[@class="error" and text() = 'Instance does not have required property "simple-string-with-enum".']</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//span[@class="error" and text() = 'Instance does not have required property "simple-boolean".']</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//span[@class="error" and text() = 'Instance does not have required property "simple-boolean".']</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//span[@class="error" and text() = 'Instance does not have required property "simple-string-with-text-area".']</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//span[@class="error" and text() = 'Instance does not have required property "simple-string-with-text-area".']</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//span[@class="error" and text() = 'Instance does not have required property "simple-integer".']</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//span[@class="error" and text() = 'Instance does not have required property "simple-integer".']</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//span[@class="error" and text() = 'Instance does not have required property "simple-integer-with-enum".']</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//span[@class="error" and text() = 'Instance does not have required property "simple-integer-with-enum".']</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//span[@class="error" and text() = 'Instance does not have required property "simple-numeric-integer".']</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//span[@class="error" and text() = 'Instance does not have required property "simple-numeric-integer".']</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//span[@class="error" and text() = 'Instance does not have required property "simple-numeric-integer-enum".']</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//span[@class="error" and text() = 'Instance does not have required property "simple-numeric-integer-enum".']</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//span[@class="error" and text() = 'Instance does not have required property "simple-numeric-float".']</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//span[@class="error" and text() = 'Instance does not have required property "simple-numeric-float".']</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//span[@class="error" and text() = 'Instance does not have required property "simple-numeric-float-enum".']</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//span[@class="error" and text() = 'Instance does not have required property "simple-numeric-float-enum".']</td>
<td></td>
</tr>
<tr>
<td colspan="3"><b> Fill the simple string</b></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//input[@name="//simple-string" and @type="text"]</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//input[@name="//simple-string" and @type="text"]</td>
<td></td>
</tr>
<tr>
<td>type</td>
<td>//input[@name="//simple-string" and @type="text"]</td>
<td>this is a simple string</td>
</tr>
<tr>
<td colspan="3"><b> Fill the string + enum</b></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//select[@name="//simple-string-with-enum"]</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//select[@name="//simple-string-with-enum"]</td>
<td></td>
</tr>
<tr>
<td>select</td>
<td>//select[@name="//simple-string-with-enum"]</td>
<td>simple string B</td>
</tr>
<tr>
<td colspan="3"><b> Fill the boolean</b></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//select[@name="//simple-boolean"]</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//select[@name="//simple-boolean"]</td>
<td></td>
</tr>
<tr>
<td>select</td>
<td>//select[@name="//simple-boolean"]</td>
<td>true</td>
</tr>
<tr>
<td colspan="3"><b> Fill the String on Text area</b></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//textarea[@name="//simple-string-with-text-area"]</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//textarea[@name="//simple-string-with-text-area"]</td>
<td></td>
</tr>
<tr>
<td>type</td>
<td>//textarea[@name="//simple-string-with-text-area"]</td>
<td>this is a simple string on a text area</td>
</tr>
<tr>
<td colspan="3"><b> Fill the simple integer</b></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//input[@name="//simple-integer" and @type="number"]</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//input[@name="//simple-integer" and @type="number"]</td>
<td></td>
</tr>
<tr>
<td>type</td>
<td>//input[@name="//simple-integer" and @type="number"]</td>
<td>1</td>
</tr>
<tr>
<td colspan="3"><b> Fill the integer + enum</b></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//select[@name="//simple-integer-with-enum"]</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//select[@name="//simple-integer-with-enum"]</td>
<td></td>
</tr>
<tr>
<td>select</td>
<td>//select[@name="//simple-integer-with-enum"]</td>
<td>7</td>
</tr>
<tr>
<td colspan="3"><b> Fill the simple numeric (integer)</b></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//input[@name="//simple-numeric-integer" and @type="number"]</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//input[@name="//simple-numeric-integer" and @type="number"]</td>
<td></td>
</tr>
<tr>
<td>type</td>
<td>//input[@name="//simple-numeric-integer" and @type="number"]</td>
<td>2</td>
</tr>
<tr>
<td colspan="3"><b> Fill the numeric integer + enum</b></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//select[@name="//simple-numeric-integer-enum"]</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//select[@name="//simple-numeric-integer-enum"]</td>
<td></td>
</tr>
<tr>
<td>select</td>
<td>//select[@name="//simple-numeric-integer-enum"]</td>
<td>13</td>
</tr>
<tr>
<td colspan="3"><b> Fill the simple numeric (float)</b></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//input[@name="//simple-numeric-float" and @type="number" and @step="any"]</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//input[@name="//simple-numeric-float" and @type="number"and @step="any"]</td>
<td></td>
</tr>
<tr>
<td>type</td>
<td>//input[@name="//simple-numeric-float" and @type="number"and @step="any"]</td>
<td>2</td>
</tr>
<tr>
<td colspan="3"><b> Fill the numeric float + enum</b></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//select[@name="//simple-numeric-float-enum"]</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//select[@name="//simple-numeric-float-enum"]</td>
<td></td>
</tr>
<tr>
<td>select</td>
<td>//select[@name="//simple-numeric-float-enum"]</td>
<td>1.25</td>
</tr>
<tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/click_proceed" />
<tr>
<td>waitForElementPresent</td>
<td>//pre[@id="parameter_output"]</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//pre[@id="parameter_output"]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//p[@id="parameter_hash"]</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//p[@id="parameter_hash"]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPGluc3RhbmNlPgogICAgPHBhcmFtZXRlciB</td>
<td></td>
</tr>
<tr>
<td>assertTextPresent</td>
<td>PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPGluc3RhbmNlPgogICAgPHBhcmFtZXRlciBpZD0ic2ltcGxlLXN0cmluZyI+dGhpcyBpcyBhIHNpbXBsZSBzdHJpbmc8L3BhcmFtZXRlcj4KICAgIDxwYXJhbWV0ZXIgaWQ9InNpbXBsZS1zdHJpbmctd2l0aC1lbnVtIj5zaW1wbGUgc3RyaW5nIEI8L3BhcmFtZXRlcj4KICAgIDxwYXJhbWV0ZXIgaWQ9InNpbXBsZS1ib29sZWFuIj50cnVlPC9wYXJhbWV0ZXI+CiAgICA8cGFyYW1ldGVyIGlkPSJzaW1wbGUtc3RyaW5nLXdpdGgtdGV4dC1hcmVhIj50aGlzIGlzIGEgc2ltcGxlIHN0cmluZyBvbiBhIHRleHQgYXJlYTwvcGFyYW1ldGVyPgogICAgPHBhcmFtZXRlciBpZD0ic2ltcGxlLWludGVnZXIiPjE8L3BhcmFtZXRlcj4KICAgIDxwYXJhbWV0ZXIgaWQ9InNpbXBsZS1pbnRlZ2VyLXdpdGgtZW51bSI+NzwvcGFyYW1ldGVyPgogICAgPHBhcmFtZXRlciBpZD0ic2ltcGxlLW51bWVyaWMtaW50ZWdlciI+MjwvcGFyYW1ldGVyPgogICAgPHBhcmFtZXRlciBpZD0ic2ltcGxlLW51bWVyaWMtaW50ZWdlci1lbnVtIj4xMzwvcGFyYW1ldGVyPgogICAgPHBhcmFtZXRlciBpZD0ic2ltcGxlLW51bWVyaWMtZmxvYXQiPjI8L3BhcmFtZXRlcj4KICAgIDxwYXJhbWV0ZXIgaWQ9InNpbXBsZS1udW1lcmljLWZsb2F0LWVudW0iPjEuMjU8L3BhcmFtZXRlcj4KPC9pbnN0YW5jZT4=
</td>
<td></td>
</tr>
</tbody>
</table>
</body>
</html>
\ 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