Commit d1e176a3 authored by Ivan Tyagov's avatar Ivan Tyagov

Add work of Xavier Hardy to improve test runner in relation with ERP5 Run My Doc

parent 7c5e7974
def UpdateImage(image):
image._update_image_info()
def urlread(url):
import urllib
return urllib.urlopen(url).read()
def editZPT(zpt, text):
zpt.pt_edit(text, 'text/html')
"""
Remove everything but the test in a webpage
"""
def parseTutorial(text, title):
import lxml.html
from lxml import etree
root = lxml.html.fromstring(text)
table_list = root.xpath('//test')
html = """
<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>"""+ title + """</title>
</head>
<body>
<table name="SELENIUM-TEST" cellpadding="1" cellspacing="1" border="1">
<thead>
<tr class="title">
<td colspan="3">"""+ title + """</td>
</tr>
</thead>
<tbody>
"""
for table in table_list:
table = table[0]
if len(table) > 0:
for row in table[-1]:
if len(row) == 1:
html += row[0].text
else:
html += lxml.html.tostring(row)
html +="""
</tbody>
</table>
</body>
</html>"""
return html
"""
Add the test at the end of the webpage (overwrite the current test if there's already one) and hide it
"""
def appendTestToWebPage(text, test_text):
import lxml.html
root = lxml.html.fromstring(text)
test_root = lxml.html.fromstring(test_text)
test_root = test_root.xpath('//table')[0]
tutorial_test = lxml.html.fromstring('<table></table>')
tutorial_test.tag = test_root.tag
for att in test_root.attrib.keys():
tutorial_test.attrib[att] = test_root.attrib[att]
tutorial_test.append(test_root[1])
hidden_list = [tutorial_test] + tutorial_test.xpath('//span')
for element in hidden_list:
element.attrib['style']='display:none;'
table_list = root.xpath('//table[@id="SELENIUM-TEST"]')
if(len(table_list) == 0):
root.append(tutorial_test)
else:
root.replace(table_list[0], tutorial_test)
return lxml.html.tostring(root).replace('\n','').replace("\'","'")
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ExternalMethod" module="Products.ExternalMethod.ExternalMethod"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_function</string> </key>
<value> <string>editZPT</string> </value>
</item>
<item>
<key> <string>_module</string> </key>
<value> <string>ERP5Zuite</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Zuite_editZPT</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Edit Page Template</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ExternalMethod" module="Products.ExternalMethod.ExternalMethod"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_function</string> </key>
<value> <string>parseTutorial</string> </value>
</item>
<item>
<key> <string>_module</string> </key>
<value> <string>ERP5Zuite</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Zuite_extractTest</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Extract Zelenium Test from tutorial</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?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>_body</string> </key>
<value> <string>request = context.REQUEST\n
now = DateTime()\n
expire_timeout_days = 1\n
session_id = request.get(\'session_id\', None)\n
if session_id is None or not session_id.startswith("erp5zuite"):\n
## first call so generate session_id and send back via cookie\n
session_id = \'erp5zuite_\' + context.REQUEST.other[\'AUTHENTICATED_USER\'].getUserName()\n
request.RESPONSE.setCookie(\'erp5_session_id\', session_id, expires=(now +expire_timeout_days).fCommon(), path=\'/\')\n
\n
session = context.portal_sessions[session_id]\n
if not session.has_key(\'tempfolder\') or session[\'tempfolder\'] == \'\':\n
session[\'tempfolder\'] = context.Zuite_createTempFolder() + \'/\'\n
\n
return session[\'tempfolder\'] + str(context.portal_ids.generateNewId(id_generator=\'zuite\', id_group=context.getId(), default=1)) + \'.png\'\n
</string> </value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Zuite_generateFilename</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?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>_body</string> </key>
<value> <string encoding="cdata"><![CDATA[
"""\n
Generate a Zuite (if necessary), create/update the test and redirect to the selenium test created/updated\n
url, web_page or web_page_reference must be set for it to work (or the context should be the Web Page in question)\n
"""\n
\n
if context.getPortalType() in [\'Web Page\', \'Test Page\'] :\n
web_page = context\n
obj_reference = context.getReference()\n
if not(obj_reference is None or not obj_reference):\n
zuite_id = obj_reference\n
else:\n
if zuite_id is None or not zuite_id:\n
zuite_id = \'tutorial_zuite\'\n
\n
no_reference = web_page_reference is None or not web_page_reference\n
no_url = url is None or not url\n
\n
validation = context.Zuite_viewZeleniumTestLauncherValidator(editor = None, request = context.REQUEST, validator = False)\n
if not validation[\'result\']:\n
return context.Base_redirect(validation[\'form_id\'], keep_items = dict(portal_status_message=validation[\'portal_status_message\']))\n
\n
if not no_url:\n
text = context.Zuite_urlRead(url)\n
elif not no_reference:\n
web_page = None\n
for page in context.portal_catalog(portal_type=\'Web Page Module\')[0].objectValues() + context.portal_catalog(portal_type=\'Test Page Module\')[0].objectValues() :\n
if page.getReference() == web_page_reference and page.getValidationState() not in [\'archived\',\'deleted\']:\n
web_page = page\n
break\n
if web_page is None or not web_page:\n
raise Exception(\'Web Page with reference <i>\' + web_page_reference + \'</i> not found.\')\n
text = web_page.getTextContent()\n
else:\n
if isinstance(web_page, str):\n
try:\n
web_page = context.restrictedTraverse(web_page)\n
except:\n
raise Exception(web_page + \' not found with restrictedTraverse.\')\n
text = web_page.getTextContent()\n
\n
portal_tests = context.getPortalObject().portal_tests\n
\n
zuite_path = portal_tests.getPath() + \'/\' + zuite_id\n
try:\n
zuite = context.restrictedTraverse(zuite_path)\n
except:\n
factory = portal_tests.manage_addProduct[\'Zelenium\']\n
factory.manage_addZuite(id=zuite_id)\n
zuite = context.restrictedTraverse(zuite_path)\n
\n
title = web_page.getTitle()\n
text = context.Zuite_extractTest(text, title)\n
\n
\n
if test_id is None or test_id == \'\':\n
test_id = \'\'.join(list(filter(lambda a: a not in ["\'",\'_\', \'-\',\'.\',\' \',\'~\', \':\', \'/\', \'?\', \'#\', \'[\', \']\', \'@\', \'!\', \'$\', \'&\', \'(\', \')\', \'*\',\'+\',\';\',\'=\'], title)))\n
\n
zuite.manage_delObjects([x.getId() for x in zuite.objectValues()])\n
\n
test_path = zuite_path + \'/\' + test_id\n
try:\n
test = context.restrictedTraverse(test_path)\n
context.Zuite_editZPT(test, text)\n
except:\n
factory = zuite.manage_addProduct[\'PageTemplates\']\n
factory.manage_addPageTemplate(test_id, title=title, text = text, REQUEST=None)\n
test = context.restrictedTraverse(test_path)\n
\n
\n
return zuite.Base_redirect("core/TestRunner.html?auto=true&test=..%2Ftest_suite_html&resultsUrl=..%2FpostResults")\n
]]></string> </value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>url = \'\', web_page = None, web_page_reference = \'\', zuite_id = \'tutorial_zuite\', test_id = \'\'</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_runSeleniumTest</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Display Selenium Test</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ExternalMethod" module="Products.ExternalMethod.ExternalMethod"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_function</string> </key>
<value> <string>UpdateImage</string> </value>
</item>
<item>
<key> <string>_module</string> </key>
<value> <string>ERP5Zuite</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Zuite_updateImage</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Zuite_updateImage</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?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>_body</string> </key>
<value> <string>"""\n
Upload a screenshot taken by the test to ERP5\n
"""\n
global msg\n
msg = \'\'\n
data_uri = context.REQUEST.form.get(\'data_uri\', \'default\')\n
def find_reference(reference, obj_list):\n
global msg\n
result = None\n
for obj in obj_list:\n
if obj.getReference() == reference:\n
result = obj\n
msg += reference + \' found\\n\'\n
break\n
return result\n
\n
web_page = find_reference(web_page_reference, context.portal_catalog(portal_type = (\'Web Page\',\'Test Page\')))\n
\n
if web_page is None or not web_page:\n
return "Web page: " + str(web_page_reference) + " not found"\n
else:\n
image = find_reference(image_reference, web_page.objectValues(portal_type = \'Image\'))\n
if image is None or not image:\n
return "Image: " + str(image_reference) + " not found"\n
\n
image.setContentType(\'image/png\')\n
data_text = data_uri.read()\n
msg += \'dataUri : \' + data_text + \'\\n\'\n
data = data_text.decode(\'base64\')\n
msg += \'data : \' + data + \'\\n\'\n
image.edit(data = data, base_data = data, filename= str(image_reference) + \'.png\', content_type = \'image/png\')\n
context.Zuite_updateImage(image)\n
msg += \'done\'\n
</string> </value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>data_uri, web_page_reference, image_reference</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_uploadScreenshot</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ExternalMethod" module="Products.ExternalMethod.ExternalMethod"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_function</string> </key>
<value> <string>urlread</string> </value>
</item>
<item>
<key> <string>_module</string> </key>
<value> <string>ERP5Zuite</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Zuite_urlRead</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Fetch content from Url</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ERP5Form" module="Products.ERP5Form.Form"/>
</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/>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_objects</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>action</string> </key>
<value> <string>Zuite_runSeleniumTest</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>edit_order</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>encoding</string> </key>
<value> <string>UTF-8</string> </value>
</item>
<item>
<key> <string>enctype</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>group_list</string> </key>
<value>
<list>
<string>left</string>
<string>right</string>
<string>center</string>
<string>bottom</string>
<string>hidden</string>
</list>
</value>
</item>
<item>
<key> <string>groups</string> </key>
<value>
<dictionary>
<item>
<key> <string>bottom</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>center</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>hidden</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>left</string> </key>
<value>
<list>
<string>your_description</string>
<string>your_url</string>
<string>your_web_page</string>
<string>your_web_page_reference</string>
</list>
</value>
</item>
<item>
<key> <string>right</string> </key>
<value>
<list>
<string>your_zuite_id</string>
<string>your_test_id</string>
</list>
</value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Zuite_viewZeleniumTestLauncher</string> </value>
</item>
<item>
<key> <string>method</string> </key>
<value> <string>POST</string> </value>
</item>
<item>
<key> <string>name</string> </key>
<value> <string>Zuite_runZeleniumTestview</string> </value>
</item>
<item>
<key> <string>pt</string> </key>
<value> <string>form_dialog</string> </value>
</item>
<item>
<key> <string>row_length</string> </key>
<value> <int>4</int> </value>
</item>
<item>
<key> <string>stored_encoding</string> </key>
<value> <string>UTF-8</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Run Zelenium Test</string> </value>
</item>
<item>
<key> <string>unicode_mode</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>update_action</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>update_action_title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ProxyField" module="Products.ERP5Form.ProxyField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>delegated_list</string> </key>
<value>
<list>
<string>default</string>
<string>editable</string>
</list>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>your_description</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
<value>
<dictionary>
<item>
<key> <string>external_validator_failed</string> </key>
<value> <string>The input failed the external validator.</string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>overrides</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>tales</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>default</string> </key>
<value> <string>Set one of the three following fields only</string> </value>
</item>
<item>
<key> <string>editable</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>field_id</string> </key>
<value> <string>my_description</string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string>Base_viewFieldLibrary</string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string>Click to edit the target</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ProxyField" module="Products.ERP5Form.ProxyField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>delegated_list</string> </key>
<value>
<list>
<string>description</string>
<string>title</string>
</list>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>your_test_id</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
<value>
<dictionary>
<item>
<key> <string>external_validator_failed</string> </key>
<value> <string>The input failed the external validator.</string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>overrides</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>tales</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>description</string> </key>
<value> <string>Enter the id of the generated test (this will overwrite any test with the same id)</string> </value>
</item>
<item>
<key> <string>field_id</string> </key>
<value> <string>my_string_field</string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string>Base_viewFieldLibrary</string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string>Click to edit the target</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Test ID</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ProxyField" module="Products.ERP5Form.ProxyField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>delegated_list</string> </key>
<value>
<list>
<string>description</string>
<string>title</string>
</list>
</value>
</item>
<item>
<key> <string>delegated_message_list</string> </key>
<value>
<list>
<string>external_validator_failed</string>
</list>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>your_url</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
<value>
<dictionary>
<item>
<key> <string>external_validator_failed</string> </key>
<value> <string>Input at least one and only ONE of those three fields.</string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>overrides</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>tales</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>description</string> </key>
<value> <string>Type the url of the page containing the Zelenium Test. (for external webpages only)</string> </value>
</item>
<item>
<key> <string>field_id</string> </key>
<value> <string>my_string_field</string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string>Base_viewFieldLibrary</string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string>Click to edit the target</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>External Url</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ProxyField" module="Products.ERP5Form.ProxyField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>delegated_list</string> </key>
<value>
<list>
<string>description</string>
<string>title</string>
</list>
</value>
</item>
<item>
<key> <string>delegated_message_list</string> </key>
<value>
<list>
<string>external_validator_failed</string>
</list>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>your_web_page</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
<value>
<dictionary>
<item>
<key> <string>external_validator_failed</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>overrides</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>tales</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>description</string> </key>
<value> <string>Enter the path to the ERP5 Web Page containing your test.</string> </value>
</item>
<item>
<key> <string>field_id</string> </key>
<value> <string>my_string_field</string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string>Base_viewFieldLibrary</string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string>Click to edit the target</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>ERP5 Web Page Path</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ProxyField" module="Products.ERP5Form.ProxyField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>delegated_list</string> </key>
<value>
<list>
<string>description</string>
<string>title</string>
</list>
</value>
</item>
<item>
<key> <string>delegated_message_list</string> </key>
<value>
<list>
<string>external_validator_failed</string>
</list>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>your_web_page_reference</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
<value>
<dictionary>
<item>
<key> <string>external_validator_failed</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>overrides</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>tales</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>description</string> </key>
<value> <string>Enter the reference to the ERP5 Web Page object containing your test.</string> </value>
</item>
<item>
<key> <string>field_id</string> </key>
<value> <string>my_string_field</string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string>Base_viewFieldLibrary</string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string>Click to edit the target</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>ERP5 Web Page Reference</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ProxyField" module="Products.ERP5Form.ProxyField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>delegated_list</string> </key>
<value>
<list>
<string>default</string>
<string>description</string>
<string>required</string>
<string>title</string>
</list>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>your_zuite_id</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
<value>
<dictionary>
<item>
<key> <string>external_validator_failed</string> </key>
<value> <string>The input failed the external validator.</string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>overrides</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>tales</string> </key>
<value>
<dictionary>
<item>
<key> <string>default</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>default</string> </key>
<value> <string>tutorial_zuite</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string>Enter the id of the Zuite containing your test.</string> </value>
</item>
<item>
<key> <string>field_id</string> </key>
<value> <string>my_string_field</string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string>Base_viewFieldLibrary</string> </value>
</item>
<item>
<key> <string>required</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string>Click to edit the target</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Zuite ID</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?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>_body</string> </key>
<value> <string>web_page_context = context.getPortalType() in [\'Web Page\', \'Test Page\']\n
\n
if web_page_context:\n
no_web_page = False\n
form_id = \'view\'\n
else:\n
no_web_page = not request.has_key(\'web_page\') or request[\'web_page\'] is None or not request[\'web_page\']\n
form_id = \'Zuite_viewZeleniumTestLauncher\'\n
\n
no_reference = not request.has_key(\'web_page_reference\') or request[\'web_page_reference\'] is None or not request[\'web_page_reference\']\n
no_url = not request.has_key(\'url\') or request[\'url\'] is None or not request[\'url\']\n
\n
if no_web_page and no_url and no_reference:\n
if validator:\n
return 0\n
else:\n
return dict(result = False, form_id = form_id, portal_status_message=context.Base_translateString("External Url (url), ERP5 Web Page Path (web_page) and ERP5 Web Page Reference (web_page_reference): were omitted, one of them must be set."))\n
elif not (no_url or no_web_page) or not (no_reference or no_web_page) or not (no_url or reference_not_set):\n
if validator:\n
return 0\n
elif web_page_context:\n
return dict(result = False, form_id = form_id, portal_status_message=context.Base_translateString("url, web_page and web_page_reference don\'t need to be set in Web Page context."))\n
else:\n
return dict(result = False, form_id = form_id, portal_status_message=context.Base_translateString("You have to choose between External Url (url), ERP5 Web Page Path (web_page) and ERP5 Web Page Reference (web_page_reference). Only ONE of them must be set."))\n
\n
if validator:\n
return 1\n
else:\n
return dict(result = True)\n
</string> </value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>editor, request, validator = True</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Zuite_viewZeleniumTestLauncherValidator</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
2011-10-11 Xavier
* Selenium core updated (2.6.0)
* captureEntirePageScreenshot is available to take screenshots with Selenium (Firefox only)
* captureEntirePageScreenshotAndUpload is available to upload the screenshots to the instance
* showOptions/hideOptions functions to help displaying drop down menus
2011-11-01 Cedric
* Add phantomRender Selenium user extension.
......
45
\ No newline at end of file
46
\ No newline at end of file
MailHostUtils
SeleniumTestUtils
\ No newline at end of file
SeleniumTestUtils
ERP5Zuite
\ 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