Commit 3b5c38b3 authored by Sven Franck's avatar Sven Franck Committed by Tristan Cavelier

erp5_corporate_identity: update templates and activate ui tests

/reviewed-on nexedi/erp5!711
parent 67655b59
......@@ -19,4 +19,8 @@
<skin_folder>erp5_corporate_identity_slide</skin_folder>
<skin_selection>Slide</skin_selection>
</skin_folder_selection>
<skin_folder_selection>
<skin_folder>erp5_xhtml_style</skin_folder>
<skin_selection>Book,Leaflet,Letter,Release,Report,Slide</skin_selection>
</skin_folder_selection>
</registered_skin_selection>
\ No newline at end of file
......@@ -13,7 +13,7 @@ blank = ''
# ------------------------------- Set Theme -----------------------------------
# XXX images in portal_skins folders don't convert with ?params. Only format
# is kept in Base_convertHtmlToSingleFile
pdf = ".pdf" if doc_format == "pdf" else blank
pdf = ".pdf.css" if doc_format == "pdf" else ".css"
css = "default_theme_css_url"
font = "default_theme_font_css_url_list"
param = "?format=png"
......@@ -43,8 +43,11 @@ theme_dict["theme_logo_description"] = theme_logo_dict.get("description", blank)
theme_dict["theme_logo_url"] = context.Base_getTemplateParameter("fallback_image")
if theme_logo_dict.get("relative_url", None) is not None:
theme_dict["theme_logo_url"] = theme_logo_dict.get("relative_url") + param
theme_dict["template_css_url"] = css_path + pdf + ".css"
theme_dict["template_css_url"] = css_path + pdf
theme_dict["fallback_img_url"] = context.Base_getTemplateParameter("fallback_image") or blank
theme_dict["theme_css_font_list"] = context.Base_getTemplateParameter(font) or []
theme_dict["theme_css_font_list"] = []
theme_font_list = context.Base_getTemplateParameter(font) or []
for font in theme_font_list:
theme_dict["theme_css_font_list"].append(font + pdf)
theme_dict["theme_css_url"] = context.Base_getTemplateParameter(css) or context.Base_getTemplateParameter(css) or blank
return theme_dict
"""
================================================================================
Return parameters to correctly display the RenderJS gadget
================================================================================
"""
# parameters
# ------------------------------------------------------------------------------
# context_url: relative url of the context calling this script
return [('editor', 'pdf'), ('portal_type', context.Letter_getPredecessor(context_url=context_url).getPortalType()), ('maximize', True)]
<?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>context_url=None</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Letter_getRenderJSExtraPreviewParameterList</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -8,7 +8,7 @@ Print letter in any of the supported formats
# parameters (*default)
# ------------------------------------------------------------------------------
# #REQUEST: request object
# #REQUEST: request object
# format: output format
# portal_skin: skin to use for output
# batch_mode: used for tests
......
......@@ -11,8 +11,7 @@
<value>
<list>
<string>default</string>
<string>description</string>
<string>gadget_url</string>
<string>renderjs_extra</string>
<string>title</string>
</list>
</value>
......@@ -57,10 +56,6 @@
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
......@@ -70,7 +65,7 @@
<value> <string></string> </value>
</item>
<item>
<key> <string>gadget_url</string> </key>
<key> <string>renderjs_extra</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
......@@ -90,21 +85,19 @@
<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>my_iframe_gadget_field</string> </value>
<value> <string>my_view_mode_text_content</string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string>Base_viewFieldLibrary</string> </value>
</item>
<item>
<key> <string>gadget_url</string> </key>
<value> <string></string> </value>
<key> <string>renderjs_extra</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>title</string> </key>
......@@ -124,7 +117,7 @@
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>python: context.Letter_getPredecessor(context_url=context.getRelativeUrl()).getData().encode("base64")</string> </value>
<value> <string>python: context.Letter_getPredecessor(context_url=context.getRelativeUrl()).absolute_url()+\'/getData\'</string> </value>
</item>
</dictionary>
</pickle>
......@@ -137,7 +130,7 @@
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>python: field.restrictedTraverse(\'pdf_js/pdfjs.gadget.html\').absolute_url() + "?auto_focus=1"</string> </value>
<value> <string>python: context.Letter_getRenderJSExtraPreviewParameterList(context_url=context.getRelativeUrl())</string> </value>
</item>
</dictionary>
</pickle>
......
......@@ -148,7 +148,7 @@ Creates the Book sections (version, authors, etc).
<td width="15%">001</td>
<td width="20%">20xx-xx-xx</td>
<td width="15%">All</td>
<td width="55%" style="text-align: left">Added example content, corrections.</td>
<td width="55%" style="text-align: right">Added example content, corrections.</td>
</tr>
</tal:block>
</tbody>
......
......@@ -33,6 +33,7 @@ if doc_save:
source_reference=''.join([doc_reference, '.pdf']),
file=doc_pdf_file
)
document.setContentType("application/pdf")
# setting aggregate in case context is an event
if context.portal_type != 'Web Page':
......
......@@ -41,7 +41,7 @@ blank = ''
# ------------------ HTML cleanup/converter methods ----------------------------
def translateText(snip):
return book_localiser.erp5_ui.gettext(snip, lang=book_language).encode('utf-8').strip()
return book_localiser.erp5_ui.gettext(snip, lang=book_language).encode('UTF-8').strip()
# -------------------------- Setup ---------------------------------------------
book = context
......@@ -84,6 +84,13 @@ book_version = html_quote(override_document_version) if override_document_versio
book_description = html_quote(override_document_description) if override_document_description else book.getDescription()
book_title = html_quote(override_document_title) if override_document_title else book.getTitle()
# unicode
if isinstance(book_content, unicode):
book_content = book_content.encode("UTF-8")
# backcompat
book_history_section_list = re.findall('<section*?>.+?</section>', book_content, re.S)
# override for tests
if override_batch_mode:
book_modification_date = DateTime("1976-11-04")
......@@ -122,7 +129,7 @@ book_table_list = []
book_table_of_content = blank
# backcompat
book_content.replace("${WebPage_insertTableOfReferences}", blank)
book_content = book_content.replace("${WebPage_insertTableOfReferences}", blank)
# XXX: not done
if book_include_history_table:
......@@ -178,8 +185,15 @@ if book_include_reference_table:
book_image_list=book_image_list,
book_table_list=book_table_list
)
if book_format == 'html' or book_format == 'mhtml':
book_content = book_references.encode('utf-8').strip() + book_content
#if book_format == 'html' or book_format == 'mhtml':
# book_references = book_references.encode('UTF-8').strip()
# backcompat for manual history tables at the beginning of documents
# NOTE: assumes <section>s are not used elsewhere!
if len(book_history_section_list) > 0:
book_content = book_content.replace(book_history_section_list[-1], (book_history_section_list[-1] + book_references.encode('UTF-8').strip()))
else:
book_content = book_references.encode('UTF-8').strip() + book_content
# table of content has to be created manually to run over everything that
# should be indexed in the toc
......@@ -188,7 +202,7 @@ if book_include_content_table:
if book_format == "pdf":
book_table_of_content = book.WebPage_createBookXslTableOfContent(
book_toc_title=book_translated_toc_title
).encode('utf-8').strip()
).encode('UTF-8').strip()
elif book_format == "html":
book_content, book_table_of_content = book.WebPage_createTableOfContent(
doc_content=book_content,
......@@ -209,6 +223,7 @@ for image in re.findall('(<img.*?/>)', book_content):
# ========================== Format: mhtml/html ================================
if book_format == "html" or book_format == "mhtml":
context.REQUEST.RESPONSE.setHeader("Content-Type", "text/html; charset=utf-8")
book_output = book.WebPage_createBook(
book_theme=book_theme.get("theme"),
book_title=book_title,
......@@ -252,7 +267,6 @@ if book_format == "html" or book_format == "mhtml":
)
if book_format == "mhtml":
context.REQUEST.RESPONSE.setHeader("Content-Type", "text/html;")
return book.Base_convertHtmlToSingleFile(book_output, allow_script=True)
# ============================= Format: pdf ====================================
......@@ -284,7 +298,7 @@ if book_format == "pdf":
book_distribution_list=book_distribution_list,
)
# book_references created above
# book_references created and added above
book_content = book.WebPage_createBookContent(
book_format=book_format,
......@@ -338,10 +352,10 @@ if book_format == "pdf":
before_toc_data_list.append(
b64encode(book.Base_convertHtmlToSingleFile(book_history, allow_script=True))
)
if book_include_reference_table:
after_toc_data_list.append(
b64encode(book.Base_convertHtmlToSingleFile(book_references, allow_script=True))
)
#if book_include_reference_table:
# after_toc_data_list.append(
# b64encode(book.Base_convertHtmlToSingleFile(book_references, allow_script=True))
# )
xsl_style_sheet_data = book_table_of_content
embedded_html_data = book.Base_convertHtmlToSingleFile(book_content, allow_script=True)
footer_embedded_html_data = book.Base_convertHtmlToSingleFile(book_foot, allow_script=True)
......
"""
================================================================================
(Backcompat) Retrieve theme parameter for Website css
================================================================================
"""
# XXX Keep until a new website template is available, the old erp5_ci_web needs
# to keep working. This method fetches the parameters required. Remove once no
# longer needed.
# parameters (* default)
# ------------------------------------------------------------------------------
# parameter: parameter to retriev
# proxy: proxy role is required to access parameter
# source_uid: uid to use when requiring parameter value
page = context
if parameter is not None:
page_theme = page.Base_getThemeDict(doc_format="html", css_path="template_css/web")
page_source = page.Base_getSourceDict(theme_logo_url=page_theme.get('theme_logo_url'))
if parameter == "Theme":
return page_theme.get("theme")
if parameter == "default_themes_css_url":
return page_theme.get("theme_css_url")
if parameter == "site_publisher":
return page_source.get('organisation_title') or ''
return "XXX could not retrieve %s" % (parameter or " undefined parameter")
<?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>parameter=None, proxy=None, source_uid=None</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>WebSite_getThemeBasedProperty</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Backcompat</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -428,6 +428,15 @@
.ci-book p + table td a {
display: block;
}
/* opinionated align for content tables, overwrite in html if required */
.ci-book a + table tbody tr td:first-child,
.ci-book a + table tbody tr th:first-child {
text-align: center;
}
.ci-book a + table tbody tr td:not(:first-child),
.ci-book a + table tbody tr th:not(:first-child) {
text-align: right;
}
/* table formatting */
.ci-book table {
......@@ -754,7 +763,9 @@ html .ci-book table td p {
padding-top: 2mm;
padding-bottom: 2mm;
}
.ci-book .ci-book-distribution-list tbody tr td ul {
.ci-book .ci-book-distribution-list tbody tr td ul,
/* backcompat */
.ci-book section tbody tr td ul {
vertical-align: top;
margin-left: 0;
padding-left: 0;
......@@ -763,14 +774,18 @@ html .ci-book table td p {
padding-top: 5mm;
padding-bottom: 5mm;
}
.ci-book .ci-book-distribution-list tbody tr td ul li {
.ci-book .ci-book-distribution-list tbody tr td ul li,
/* backcompat */
.ci-book section tbody tr td ul li {
padding: 0;
list-style: none;
text-indent: 0;
line-height: 18pt;
text-align: left;
}
.ci-book .ci-book-distribution-list tbody tr td ul li:before {
.ci-book .ci-book-distribution-list tbody tr td ul li:before,
/* backcompat */
.ci-book section tbody tr td ul li:before {
content: "■";
padding-right: 8px;
vertical-align: middle;
......@@ -783,9 +798,20 @@ html .ci-book table td p {
box-sizing: border-box;
display: inline-block;
}
/* backcompat */
.ci-book section tbody tr td ul li span,
.ci-book section tbody tr td ul li div,
.ci-book section tbody tr td ul li p {
display: inline-block;
width: 46%;
}
.ci-book .ci-book-distribution-list tbody tr td ul li,
.ci-book .ci-book-distribution-list tbody tr td ul div,
.ci-book .ci-book-distribution-list tbody tr td ul span {
.ci-book .ci-book-distribution-list tbody tr td ul span,
/* backcompat */
.ci-book section tbody tr td ul li,
.ci-book section tbody tr td ul div,
.ci-book section tbody tr td ul span {
vertical-align: middle;
}
/* Version List */
......
......@@ -421,6 +421,15 @@
padding: 0 2mm;
text-align: center;
}
/* opinionated align for content tables, overwrite in html if required */
.ci-book a + table tbody tr td:first-child,
.ci-book a + table tbody tr th:first-child {
text-align: center;
}
.ci-book a + table tbody tr td:not(:first-child),
.ci-book a + table tbody tr th:not(:first-child) {
text-align: right;
}
.ci-book table thead tr th p {
color: black !important;
}
......@@ -758,23 +767,29 @@ html .ci-book table td p {
padding-top: 2mm;
padding-bottom: 2mm;
}
.ci-book .ci-book-distribution-list tbody tr td ul {
.ci-book .ci-book-distribution-list tbody tr td ul,
/* backcompat */
.ci-book section tbody tr td ul {
vertical-align: top;
margin-left: 0;
padding-left: 0;
display: inline-block;
width: 49%;
width: 47%;
padding-top: 5mm;
padding-bottom: 5mm;
}
.ci-book .ci-book-distribution-list tbody tr td ul li {
.ci-book .ci-book-distribution-list tbody tr td ul li,
/* backcompat */
.ci-book section tbody tr td ul li {
padding: 0;
list-style: none;
text-indent: 0;
line-height: 18pt;
text-align: left;
}
.ci-book .ci-book-distribution-list tbody tr td ul li:before {
.ci-book .ci-book-distribution-list tbody tr td ul li:before,
/* backcompat */
.ci-book section tbody tr td ul li:before {
content: "■";
padding-right: 8px;
vertical-align: middle;
......@@ -787,9 +802,20 @@ html .ci-book table td p {
box-sizing: border-box;
display: inline-block;
}
/* backcompat */
.ci-book section tbody tr td ul li span,
.ci-book section tbody tr td ul li div,
.ci-book section tbody tr td ul li p {
display: inline-block;
}
.ci-book .ci-book-distribution-list tbody tr td ul li,
.ci-book .ci-book-distribution-list tbody tr td ul div,
.ci-book .ci-book-distribution-list tbody tr td ul span {
.ci-book .ci-book-distribution-list tbody tr td ul span,
/* backcompat */
.ci-book section tbody tr td ul li,
.ci-book section tbody tr td ul div,
.ci-book section tbody tr td ul span,
.ci-book section tbody tr td ul p {
vertical-align: middle;
}
/* Version List */
......
......@@ -11,7 +11,8 @@ html {
/* === font size === */
.ci-slideshow h1,
.ci-slideshow h2 {
.ci-slideshow h2,
.ci-slideshow-handout .ci-slideshow-handout-header {
font-size: 42px;
}
.ci-slideshow h1 ~ *:not(h2),
......@@ -28,19 +29,25 @@ html {
.ci-slideshow code {
font-size: 20px;
}
.ci-slideshow-handout section section pre,
.ci-slideshow-handout section section code {
font-size: 5mm;
}
.ci-slideshow-handout h1,
.ci-slideshow-handout h2 {
font-size: 24px;
}
.ci-slideshow .ci-slideshow-intro:before {
font-size: 28px;
}
.ci-slideshow-handout ul li,
.ci-slideshow-handout ul li a,
.ci-slideshow-handout div p {
font-size: 24px;
}
.ci-slideshow .ci-slideshow-intro:before {
font-size: 28px;
}
.ci-slideshow-handout details {
.ci-slideshow-handout details,
.ci-slideshow-handout details ul li,
.ci-slideshow-handout details ul li a {
font-size: 20px;
}
.ci-slideshow-footer div,
......@@ -195,10 +202,12 @@ section {
width: auto;
}
/* code */
html .ci-slideshow code {
html .ci-slideshow code,
html .ci-slideshow-handout code {
background-color: #eee;
}
html .ci-slideshow pre {
html .ci-slideshow pre,
html .ci-slideshow-handout pre {
-webkit-box-shadow: none;
-moz-box-shadow: none;
box-shadow: none;
......@@ -222,6 +231,15 @@ html .ci-slideshow pre {
display: inline-block;
margin-top: 10%;
}
.ci-slideshow section ul ul,
.ci-slideshow section ul ol,
.ci-slideshow section ol ul,
.ci-slideshow section ol ol {
padding: 0;
margin: 0;
margin-left: 4%;
margin-top: 1%;
}
.ci-slideshow section details ul,
.ci-slideshow section details ol {
display: block
......@@ -490,7 +508,7 @@ html .ci-slideshow section img + img:last-child {
.ci-slideshow-handout,
.ci-slideshow-handout h1,
.ci-slideshow-handout details {
color: #969696;
color: #000; /* JP can't read #969696; */
}
.ci-slideshow-handout section section ul,
.ci-slideshow-handout section section ol {
......
......@@ -3,4 +3,10 @@ erp5_corporate_identity_book | Report
erp5_corporate_identity_leaflet | Leaflet
erp5_corporate_identity_letter | Letter
erp5_corporate_identity_release | Release
erp5_corporate_identity_slide | Slide
\ No newline at end of file
erp5_corporate_identity_slide | Slide
erp5_xhtml_style | Book
erp5_xhtml_style | Leaflet
erp5_xhtml_style | Letter
erp5_xhtml_style | Release
erp5_xhtml_style | Report
erp5_xhtml_style | Slide
\ No newline at end of file
......@@ -39,7 +39,7 @@
</item>
<item>
<key> <string>_EtagSupport__etag</string> </key>
<value> <string>ts23973667.4</string> </value>
<value> <string>ts28818112.51</string> </value>
</item>
<item>
<key> <string>_Modify_portal_content_Permission</string> </key>
......@@ -83,7 +83,7 @@
</item>
<item>
<key> <string>content_md5</string> </key>
<value> <string>bb2054b607ee9817f218e15e52789e29</string> </value>
<value> <string>3521a0724f55d83b02da77987d086c17</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
......@@ -125,7 +125,7 @@
</item>
<item>
<key> <string>size</string> </key>
<value> <int>86901</int> </value>
<value> <int>108153</int> </value>
</item>
<item>
<key> <string>title</string> </key>
......
......@@ -39,7 +39,7 @@
</item>
<item>
<key> <string>_EtagSupport__etag</string> </key>
<value> <string>ts23973691.25</string> </value>
<value> <string>ts28818148.81</string> </value>
</item>
<item>
<key> <string>_Modify_portal_content_Permission</string> </key>
......@@ -83,7 +83,7 @@
</item>
<item>
<key> <string>content_md5</string> </key>
<value> <string>4c7c69526342683cdd01eb8c580e2dd1</string> </value>
<value> <string>a0ce9582f7c99820f6f14b3278be4166</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
......@@ -125,7 +125,7 @@
</item>
<item>
<key> <string>size</string> </key>
<value> <int>161904</int> </value>
<value> <int>180285</int> </value>
</item>
<item>
<key> <string>title</string> </key>
......
......@@ -39,7 +39,7 @@
</item>
<item>
<key> <string>_EtagSupport__etag</string> </key>
<value> <string>ts23973710.89</string> </value>
<value> <string>ts28818185.46</string> </value>
</item>
<item>
<key> <string>_Modify_portal_content_Permission</string> </key>
......@@ -83,7 +83,7 @@
</item>
<item>
<key> <string>content_md5</string> </key>
<value> <string>090b6879eb49e5182c1101363a9018c8</string> </value>
<value> <string>2a62c7336be2e26f88121148d3753af5</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
......
......@@ -39,7 +39,7 @@
</item>
<item>
<key> <string>_EtagSupport__etag</string> </key>
<value> <string>ts24219940.57</string> </value>
<value> <string>ts28793492.71</string> </value>
</item>
<item>
<key> <string>_Modify_portal_content_Permission</string> </key>
......@@ -83,7 +83,7 @@
</item>
<item>
<key> <string>content_md5</string> </key>
<value> <string>e081a527a4a14481a854b204dfb9e69f</string> </value>
<value> <string>9d769a9126156dec2c1abaea8e831309</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
......
......@@ -39,7 +39,7 @@
</item>
<item>
<key> <string>_EtagSupport__etag</string> </key>
<value> <string>ts24219963.95</string> </value>
<value> <string>ts28793535.06</string> </value>
</item>
<item>
<key> <string>_Modify_portal_content_Permission</string> </key>
......@@ -83,7 +83,7 @@
</item>
<item>
<key> <string>content_md5</string> </key>
<value> <string>527ab92a98ac5c36c06c3b421e0e80cb</string> </value>
<value> <string>50533d58c881785e959dac0abf7edea7</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
......
......@@ -39,7 +39,7 @@
</item>
<item>
<key> <string>_EtagSupport__etag</string> </key>
<value> <string>ts24219998.56</string> </value>
<value> <string>ts28793562.83</string> </value>
</item>
<item>
<key> <string>_Modify_portal_content_Permission</string> </key>
......@@ -83,7 +83,7 @@
</item>
<item>
<key> <string>content_md5</string> </key>
<value> <string>7aeb14dddc4606daf750e8e5d5b364f9</string> </value>
<value> <string>51e0e212c20bd112c07bb99b7ad58d68</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
......
......@@ -39,7 +39,7 @@
</item>
<item>
<key> <string>_EtagSupport__etag</string> </key>
<value> <string>ts24219736.6</string> </value>
<value> <string>ts28793785.32</string> </value>
</item>
<item>
<key> <string>_Modify_portal_content_Permission</string> </key>
......@@ -83,7 +83,7 @@
</item>
<item>
<key> <string>content_md5</string> </key>
<value> <string>af71e66beb6943dd195610dd9a7d490f</string> </value>
<value> <string>962518be8d584e7d3eba04a641c4f415</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
......
......@@ -39,7 +39,7 @@
</item>
<item>
<key> <string>_EtagSupport__etag</string> </key>
<value> <string>ts24219753.19</string> </value>
<value> <string>ts28793805.71</string> </value>
</item>
<item>
<key> <string>_Modify_portal_content_Permission</string> </key>
......@@ -83,7 +83,7 @@
</item>
<item>
<key> <string>content_md5</string> </key>
<value> <string>41e3ace41fba409cd960a8033195f24b</string> </value>
<value> <string>6fb54895e66d500afbdadef7dff60b4d</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
......
......@@ -39,7 +39,7 @@
</item>
<item>
<key> <string>_EtagSupport__etag</string> </key>
<value> <string>ts24219777.67</string> </value>
<value> <string>ts28793846.92</string> </value>
</item>
<item>
<key> <string>_Modify_portal_content_Permission</string> </key>
......@@ -83,7 +83,7 @@
</item>
<item>
<key> <string>content_md5</string> </key>
<value> <string>7825bf344ed5c4c48b36fd0f010d868d</string> </value>
<value> <string>942b2344e8b6ac86aa6577c931866998</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
......
......@@ -39,7 +39,7 @@
</item>
<item>
<key> <string>_EtagSupport__etag</string> </key>
<value> <string>ts24219796.65</string> </value>
<value> <string>ts28793867.29</string> </value>
</item>
<item>
<key> <string>_Modify_portal_content_Permission</string> </key>
......@@ -83,7 +83,7 @@
</item>
<item>
<key> <string>content_md5</string> </key>
<value> <string>83f44808946bd7de4b403b4647d3d281</string> </value>
<value> <string>5990ddcff7022659a9872b95df5e47d4</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
......
......@@ -39,7 +39,7 @@
</item>
<item>
<key> <string>_EtagSupport__etag</string> </key>
<value> <string>ts24219848.05</string> </value>
<value> <string>ts28882626.08</string> </value>
</item>
<item>
<key> <string>_Modify_portal_content_Permission</string> </key>
......@@ -83,7 +83,7 @@
</item>
<item>
<key> <string>content_md5</string> </key>
<value> <string>1f4ddeeaea584acb7ded363458f4f156</string> </value>
<value> <string>79a3d8b38376c4e101137656d4a28dcd</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
......
......@@ -39,7 +39,7 @@
</item>
<item>
<key> <string>_EtagSupport__etag</string> </key>
<value> <string>ts24219871.79</string> </value>
<value> <string>ts28882547.32</string> </value>
</item>
<item>
<key> <string>_Modify_portal_content_Permission</string> </key>
......@@ -83,7 +83,7 @@
</item>
<item>
<key> <string>content_md5</string> </key>
<value> <string>9077e814ba6792079b84d2e21d1820bc</string> </value>
<value> <string>0999833df18e7433a0639d5c728b2ef4</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
......
......@@ -39,7 +39,7 @@
</item>
<item>
<key> <string>_EtagSupport__etag</string> </key>
<value> <string>ts24220068.43</string> </value>
<value> <string>ts28793940.04</string> </value>
</item>
<item>
<key> <string>_Modify_portal_content_Permission</string> </key>
......@@ -83,7 +83,7 @@
</item>
<item>
<key> <string>content_md5</string> </key>
<value> <string>b056cab4e707f24ad4538899929b6cbd</string> </value>
<value> <string>41bbc3e9d011d7a7cac9a84d2f4b14d6</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
......
......@@ -39,7 +39,7 @@
</item>
<item>
<key> <string>_EtagSupport__etag</string> </key>
<value> <string>ts24220090.65</string> </value>
<value> <string>ts28793968.68</string> </value>
</item>
<item>
<key> <string>_Modify_portal_content_Permission</string> </key>
......@@ -83,7 +83,7 @@
</item>
<item>
<key> <string>content_md5</string> </key>
<value> <string>fe10e65e99bbede9c04fa45fdf1a1165</string> </value>
<value> <string>c1ae66d5d3849d4e018cc093a8ecd079</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
......
......@@ -39,7 +39,7 @@
</item>
<item>
<key> <string>_EtagSupport__etag</string> </key>
<value> <string>ts23978445.11</string> </value>
<value> <string>ts28796891.17</string> </value>
</item>
<item>
<key> <string>_Modify_portal_content_Permission</string> </key>
......@@ -83,7 +83,7 @@
</item>
<item>
<key> <string>content_md5</string> </key>
<value> <string>3879ec0b0c1f58c41ccc3626e44c9b7a</string> </value>
<value> <string>c566e3c9adb8cf7e23e6de714d527efe</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
......
......@@ -39,7 +39,7 @@
</item>
<item>
<key> <string>_EtagSupport__etag</string> </key>
<value> <string>ts23978485.91</string> </value>
<value> <string>ts28796968.67</string> </value>
</item>
<item>
<key> <string>_Modify_portal_content_Permission</string> </key>
......@@ -83,7 +83,7 @@
</item>
<item>
<key> <string>content_md5</string> </key>
<value> <string>c46b41ab18fcd6902af839662acf0914</string> </value>
<value> <string>e7b357b0b0c08656696e52510120efd1</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
......
......@@ -39,7 +39,7 @@
</item>
<item>
<key> <string>_EtagSupport__etag</string> </key>
<value> <string>ts23978507.58</string> </value>
<value> <string>ts28797008.41</string> </value>
</item>
<item>
<key> <string>_Modify_portal_content_Permission</string> </key>
......@@ -83,7 +83,7 @@
</item>
<item>
<key> <string>content_md5</string> </key>
<value> <string>3085fbe4d726274917ee1bbf99c143c6</string> </value>
<value> <string>70a57c0723069395546e29825d9a5176</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
......
......@@ -39,7 +39,7 @@
</item>
<item>
<key> <string>_EtagSupport__etag</string> </key>
<value> <string>ts23978467.48</string> </value>
<value> <string>ts28796928.44</string> </value>
</item>
<item>
<key> <string>_Modify_portal_content_Permission</string> </key>
......@@ -83,7 +83,7 @@
</item>
<item>
<key> <string>content_md5</string> </key>
<value> <string>71bcd0c501c0c172233b85d61eddf9c8</string> </value>
<value> <string>274c1d5153a216b28c603cbe86e17942</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
......@@ -125,7 +125,7 @@
</item>
<item>
<key> <string>size</string> </key>
<value> <int>377618</int> </value>
<value> <int>377473</int> </value>
</item>
<item>
<key> <string>title</string> </key>
......
......@@ -39,7 +39,7 @@
</item>
<item>
<key> <string>_EtagSupport__etag</string> </key>
<value> <string>ts23978532.86</string> </value>
<value> <string>ts28797054.07</string> </value>
</item>
<item>
<key> <string>_Modify_portal_content_Permission</string> </key>
......@@ -83,11 +83,11 @@
</item>
<item>
<key> <string>content_md5</string> </key>
<value> <string>37cafef1d815c7dcc22ff218298f3757</string> </value>
<value> <string>8743d85788c04220a3c7ab55538d1467</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>application/unknown</string> </value>
<value> <string>application/pdf</string> </value>
</item>
<item>
<key> <string>default_reference</string> </key>
......@@ -125,7 +125,7 @@
</item>
<item>
<key> <string>size</string> </key>
<value> <int>381449</int> </value>
<value> <int>381275</int> </value>
</item>
<item>
<key> <string>title</string> </key>
......
......@@ -79,7 +79,7 @@
</item>
<item>
<key> <string>content_md5</string> </key>
<value> <string>c94e282b3ef308a01909e97442f859fc</string> </value>
<value> <string>1fa4ce97d8ab6401164a4f774cdad85f</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
......
......@@ -79,7 +79,7 @@
</item>
<item>
<key> <string>content_md5</string> </key>
<value> <string>44cd41a98bcace059855dbd43ca00082</string> </value>
<value> <string>231780bc3ee170b538da62e734177a40</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
......
......@@ -79,7 +79,7 @@
</item>
<item>
<key> <string>content_md5</string> </key>
<value> <string>aea99e06b679d35dc50b86fc964a66d3</string> </value>
<value> <string>4a92af525f76b275d4d73a8ead62d4f0</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
......
......@@ -79,7 +79,7 @@
</item>
<item>
<key> <string>content_md5</string> </key>
<value> <string>29a2c357be83b6e22ab7e3cc46d7d4fd</string> </value>
<value> <string>6f73555274e70c9a2f41ee6738d3e8e3</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
......
......@@ -79,7 +79,7 @@
</item>
<item>
<key> <string>content_md5</string> </key>
<value> <string>baa58e79cb47cac9acd69e92f9ff4194</string> </value>
<value> <string>b663eec882823e2c8df1c55e77bf9510</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
......
......@@ -79,7 +79,7 @@
</item>
<item>
<key> <string>content_md5</string> </key>
<value> <string>33dd061d418f33c442a25181e77f6165</string> </value>
<value> <string>125dda705d2c7c8942345bf6f5dd3eaa</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
......
......@@ -6,1858 +6,1930 @@
</head>
<body>
<!--
UPDATE comparison files for LIVE TESTS | DON'T RUN AUTOMATICALLY
(else tests will always pass...)
TEST UI and/or UPDATE FILES for live tests
This Zuite updates all test files (diff-html, pdfs, bmps) used in the LiveTests
based on the example web pages included in this bt5. Run this zuite after making
changes to the bt5 which will alter their look to automatically update all files
(else you need to do it by hand). This also means: DON'T RUN THIS AUTOMATICALLY,
because it will also update all test files with any errors you make, causing
liveTests to always pass (comparing wrong rendering to wrong test file).
This Zuite updates all test files (diff-html, pdfs, bmp) used in the LiveTests
based on the example web pages included in this bt5. The parameter no_file_update
determines whether files are updated (default True). To update test files,
create a script Zuite_setSkipSave in custom folder which returns False
Help:
http://www.seleniumhq.org/docs/02_selenium_ide.jsp#selenium-commands-selenese
http://seleniummaster.com/sitecontent/index.php/introduction-to-selenium-automation/selenium-ide/114-selenium-ide-complete-list-of-commands
# Note:
# make sure to set editor to plain text in (erp5 test preferences)
Note:
# uses pause when updating files to wait for Cloudooo pdf rendering
# requires text-area editor
# test waitForTitle does not work in FF
-->
<table cellpadding="1" cellspacing="1" border="1">
<thead>
<tr><td rowspan="1" colspan="3">Test RenderJS UI</td></tr>
</thead><tbody>
<tal:block metal:use-macro="here/Zuite_CommonTemplate/macros/init" />
<tr><td rowspan="1" colspan="3">Test Book Template UI</td></tr>
</thead>
<tbody>
<tal:block metal:use-macro="here/Zuite_CommonTemplate/macros/init" />
<tal:block tal:define="portal here/portal_url/getPortalObject;
caller python: getattr(context, 'Zuite_setSkipSave', None);
no_file_update python: caller() if caller is not None else True;">
<tr>
<td>open</td>
<td>${base_url}/bar_module/ListBoxZuite_reset</td>
<td></td>
</tr>
<tr>
<td>assertTextPresent</td>
<td>Reset Successfully.</td>
<td></td>
</tr>
<tr>
<td>open</td>
<td>${base_url}/Zuite_setPreferredTextEditor</td>
<td></td>
</tr>
<tr>
<td>assertTextPresent</td>
<td>Editor set to Textarea.</td>
<td></td>
</tr>
<tr>
<td>echo</td>
<td tal:content="python: ''.join(['skipping save: ', str(no_file_update)])"></td>
<td></td>
</tr>
<tal:block tal:condition="python: no_file_update == True">
<tr>
<td>open</td>
<td>${base_url}/Zuite_setConversionServerUrl</td>
<td></td>
</tr>
<tr>
<td>assertTextPresent</td>
<td>Conversion Server Url set.</td>
<td></td>
</tr>
</tal:block>
<tr>
<td>echo</td>
<td>ACTION => EXPORT</td>
<td></td>
</tr>
<!-- CASE 1: template_test_book_output_expected_001_en_html -->
<tr>
<td>echo</td>
<td>ACTION => EXPORT</td>
<td></td>
</tr>
<tr>
<td>echo</td>
<td>CASE 1 => template_test_book_output_expected_001_en_html</td>
<td></td>
</tr>
<tr>
<td>open</td>
<td>${base_url}/web_page_module/</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>records</td>
<td></td>
</tr>
<tr>
<td>type</td>
<td>name=listbox_reference</td>
<td>Template.Test.Book</td>
</tr>
<tr>
<td>type</td>
<td>name=listbox_version</td>
<td>001</td>
</tr>
<tr>
<td>keyPressAndWait</td>
<td>listbox_version</td>
<td>\13</td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Template Test Book</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[contains(text(), 'Template.Test.Book')]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Short Title</td>
<td></td>
</tr>
<!-- Save once to set modification date for live tests -->
<tr>
<td>waitForElementPresent</td>
<td>//button[@class="save"]</td>
<td></td>
</tr>
<tr>
<td>verifyElementPresent</td>
<td>//button[@class="save"]</td>
<td></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>//button[@class="save"]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[@class="transition_message"]</td>
<td></td>
</tr>
<tr>
<td>assertTextPresent</td>
<td>Data updated.</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//button[@class="import_export"]</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//button[@class="import_export"]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Export Slideshow</td>
<td></td>
</tr>
<tr>
<td>selectAndWait</td>
<td>name=select_dialog</td>
<td>index=3</td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Export Book</td>
<td></td>
</tr>
<tr>
<td>uncheck</td>
<td>name=field_include_content_table</td>
<td></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>name=Base_showUpdateDialog:method</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[@class="transition_message"]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Preview updated.</td>
<td></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>name=Base_callDialogMethod:method</td>
<td></td>
</tr>
<tr>
<td>waitForElementNotPresent</td>
<td>name=Base_callDialogMethod:method</td>
<td></td>
</tr>
<tr>
<td>waitForPageToLoad</td>
<td></td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>ISO 16016</td>
<td></td>
</tr>
<tal:block tal:condition="python: no_file_update == False">
<tr>
<td>storeLocation</td>
<td>url</td>
<td></td>
</tr>
<tr>
<td>echo</td>
<td>${url}</td>
<td></td>
</tr>
<tr>
<td>open</td>
<td>${base_url}/bar_module/ListBoxZuite_reset</td>
<td></td>
</tr>
<tr>
<td>assertTextPresent</td>
<td>Reset Successfully.</td>
<td></td>
</tr>
<!-- Can't fetch iframe source, so request page again -->
<tr>
<td>storeEval</td>
<td>function ajax(url) {var xhr = new XMLHttpRequest();return new Promise(function(resolve, reject) {var k;xhr.open("GET", url, true);xhr.addEventListener("load", function(e) {if (e.target.status >= 400) {return reject(e);}resolve(e);});xhr.addEventListener("error", reject);xhr.send();}, function() {xhr.abort();});};ajax(storedVars["url"] + "&amp;batch_mode=True");</td>
<td>page_source</td>
</tr>
</tal:block>
<tr>
<td>goBackAndWait</td>
<td></td>
<td></td>
</tr>
<tr>
<td>waitForPageToLoad</td>
<td></td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Web Pages</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[contains(text(), 'Web Pages')]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>records</td>
<td></td>
</tr>
<tr>
<td>type</td>
<td>name=listbox_reference</td>
<td>%Template% AND %Output% AND %Book%</td>
</tr>
<tr>
<td>type</td>
<td>name=listbox_version</td>
<td>001</td>
</tr>
<tr>
<td>keyPressAndWait</td>
<td>listbox_reference</td>
<td>\13</td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Template.Test.Book.Expected.Output.Sample</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[contains(text(), 'Template.Test.Book.Expected.Output.Sample')]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Short Title</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//a/span[contains(text(), 'Edit')]</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a/span[contains(text(), 'Edit')]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[@class="input"]/div/textarea</td>
<td></td>
</tr>
<tal:block tal:condition="python: no_file_update == False">
<tr>
<td>storeEval</td>
<td>storedVars["page_source"].then(function (evt) {var content = evt.target.response || evt.target.responseText;document.getElementById("selenium_myiframe").contentDocument.body.bad_parameter = content;})</td>
<td></td>
</tr>
<tr>
<td>storeEval</td>
<td>document.getElementById("selenium_myiframe").contentDocument.body.bad_parameter;</td>
<td>dump</td>
</tr>
<tr>
<td>type</td>
<td>//div[@class="input"]/div/textarea</td>
<td>${dump}</td>
</tr>
</tal:block>
<tr>
<td>verifyElementPresent</td>
<td>//button[@class="save"]</td>
<td></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>//button[@class="save"]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[@class="transition_message"]</td>
<td></td>
</tr>
<tr>
<td>assertTextPresent</td>
<td>Data updated.</td>
<td></td>
</tr>
<!-- CASE 2: - template_test_book_output_expected_002_en_html -->
<tr>
<td>echo</td>
<td>CASE 2 => template_test_lealflet_book_expected_002_en_html</td>
<td></td>
</tr>
<tr>
<td>verifyTextPresent</td>
<td>Web Pages</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[contains(text(), 'Web Pages')]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>records</td>
<td></td>
</tr>
<tr>
<td>type</td>
<td>name=listbox_reference</td>
<td>Template.Test.Book</td>
</tr>
<tr>
<td>type</td>
<td>name=listbox_version</td>
<td>001</td>
</tr>
<tr>
<td>keyPressAndWait</td>
<td>listbox_version</td>
<td>\13</td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Template Test Book</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[contains(text(), 'Template.Test.Book')]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Short Title</td>
<td></td>
</tr>
<!-- don't save once to set modification date for live tests, because this
will up revision and it's the second time this document is used, so
revision on prior tests using this web page will be off by 1
<tr>
<td>waitForElementPresent</td>
<td>//button[@class="save"]</td>
<td></td>
</tr>
<tr>
<td>verifyElementPresent</td>
<td>//button[@class="save"]</td>
<td></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>//button[@class="save"]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[@class="transition_message"]</td>
<td></td>
</tr>
<tr>
<td>assertTextPresent</td>
<td>Data updated.</td>
<td></td>
</tr>
-->
<tr>
<td>waitForElementPresent</td>
<td>//button[@class="import_export"]</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//button[@class="import_export"]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Export Slideshow</td>
<td></td>
</tr>
<tr>
<td>selectAndWait</td>
<td>name=select_dialog</td>
<td>index=3</td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Export Book</td>
<td></td>
</tr>
<!-- Base_callDialogMethod max 2000 chars for url_params_string fails here -->
<tr>
<td>type</td>
<td>name=field_override_logo_reference</td>
<td>Template.Test.Image.Erp5.Logo</td>
</tr>
<tr>
<td>clickAndWait</td>
<td>name=Base_showUpdateDialog:method</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[@class="transition_message"]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Preview updated.</td>
<td></td>
</tr>
<tr>
<td>check</td>
<td>name=field_include_history_table</td>
<td></td>
</tr>
<tr>
<td>check</td>
<td>name=field_include_content_table</td>
<td></td>
</tr>
<tr>
<td>check</td>
<td>name=field_include_reference_table</td>
<td></td>
</tr>
<tr>
<td>check</td>
<td>name=field_include_linked_content</td>
<td></td>
</tr>
<tr>
<td>check</td>
<td>name=field_include_report_content</td>
<td></td>
</tr>
<tr>
<td>type</td>
<td>name=field_override_document_description</td>
<td>foobar</td>
</tr>
<tr>
<td>type</td>
<td>name=field_override_document_title</td>
<td>Couscous</td>
</tr>
<tr>
<td>type</td>
<td>name=field_override_document_short_title</td>
<td>Cous</td>
</tr>
<tr>
<td>type</td>
<td>name=field_override_document_reference</td>
<td>P-XYZ-Foobar</td>
</tr>
<tr>
<td>type</td>
<td>name=field_override_source_organisation_title</td>
<td>Test Organisation</td>
</tr>
<tr>
<td>type</td>
<td>name=field_override_source_person_title</td>
<td>Test Sender</td>
</tr>
<tr>
<td>type</td>
<td>name=field_override_document_version</td>
<td>333</td>
</tr>
<tr>
<td>clickAndWait</td>
<td>name=Base_callDialogMethod:method</td>
<td></td>
</tr>
<tr>
<td>waitForElementNotPresent</td>
<td>name=Base_callDialogMethod:method</td>
<td></td>
</tr>
<tr>
<td>waitForPageToLoad</td>
<td></td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>ISO 16016</td>
<td></td>
</tr>
<tal:block tal:condition="python: no_file_update == False">
<!-- store URL for rerequesting -->
<tr>
<td>storeLocation</td>
<td>url</td>
<td></td>
</tr>
<tr>
<td>echo</td>
<td>${url}</td>
<td></td>
</tr>
<!-- update 1st output - template_test_book_output_expected_001_en_html -->
<tr>
<td>echo</td>
<td>action => export</td>
<td></td>
</tr>
<tr>
<td>echo</td>
<td>update => template_test_book_output_expected_001_en_html</td>
<td></td>
</tr>
<tr>
<td>open</td>
<td>${base_url}/web_page_module/</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>records</td>
<td></td>
</tr>
<tr>
<td>type</td>
<td>name=listbox_reference</td>
<td>Template.Test.Book</td>
</tr>
<tr>
<td>type</td>
<td>name=listbox_version</td>
<td>001</td>
</tr>
<tr>
<td>keyPressAndWait</td>
<td>listbox_version</td>
<td>\13</td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Template Test Book</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[contains(text(), 'Template.Test.Book')]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Short Title</td>
<td></td>
</tr>
<!-- Save once to set modification date for live tests -->
<tr>
<td>waitForElementPresent</td>
<td>//button[@class="save"]</td>
<td></td>
</tr>
<tr>
<td>verifyElementPresent</td>
<td>//button[@class="save"]</td>
<td></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>//button[@class="save"]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[@class="transition_message"]</td>
<td></td>
</tr>
<tr>
<td>assertTextPresent</td>
<td>Data updated.</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//button[@class="import_export"]</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//button[@class="import_export"]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Export Slideshow</td>
<td></td>
</tr>
<tr>
<td>selectAndWait</td>
<td>name=select_dialog</td>
<td>index=3</td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Export Book</td>
<td></td>
</tr>
<tr>
<td>uncheck</td>
<td>name=field_include_content_table</td>
<td></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>name=Base_showUpdateDialog:method</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[@class="transition_message"]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Preview updated.</td>
<td></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>name=Base_callDialogMethod:method</td>
<td></td>
</tr>
<tr>
<td>waitForElementNotPresent</td>
<td>name=Base_callDialogMethod:method</td>
<td></td>
</tr>
<tr>
<td>waitForPageToLoad</td>
<td></td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>ISO 16016</td>
<td></td>
</tr>
<tr>
<td>storeLocation</td>
<td>url</td>
<td></td>
</tr>
<tr>
<td>echo</td>
<td>${url}</td>
<td></td>
</tr>
<!-- Can't fetch iframe source, so request page again -->
<tr>
<td>storeEval</td>
<td>function ajax(url) {var xhr = new XMLHttpRequest();return new Promise(function(resolve, reject) {var k;xhr.open("GET", url, true);xhr.addEventListener("load", function(e) {if (e.target.status >= 400) {return reject(e);}resolve(e);});xhr.addEventListener("error", reject);xhr.send();}, function() {xhr.abort();});};ajax(storedVars["url"] + "&amp;batch_mode=True");</td>
<td>page_source</td>
</tr>
<tr>
<td>goBackAndWait</td>
<td></td>
<td></td>
</tr>
<tr>
<td>waitForPageToLoad</td>
<td></td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Web Pages</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[contains(text(), 'Web Pages')]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>records</td>
<td></td>
</tr>
<tr>
<td>type</td>
<td>name=listbox_reference</td>
<td>%Template% AND %Output% AND %Book%</td>
</tr>
<tr>
<td>type</td>
<td>name=listbox_version</td>
<td>001</td>
</tr>
<tr>
<td>keyPressAndWait</td>
<td>listbox_reference</td>
<td>\13</td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Template.Test.Book.Expected.Output.Sample</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[contains(text(), 'Template.Test.Book.Expected.Output.Sample')]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Short Title</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//a/span[contains(text(), 'Edit')]</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a/span[contains(text(), 'Edit')]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//textarea[@name="field_my_text_content"]</td>
<td></td>
</tr>
<tr>
<td>storeEval</td>
<td>storedVars["page_source"].then(function (evt) {var content = evt.target.response || evt.target.responseText;document.getElementById("selenium_myiframe").contentDocument.body.bad_parameter = content;})</td>
<td></td>
</tr>
<tr>
<td>storeEval</td>
<td>document.getElementById("selenium_myiframe").contentDocument.body.bad_parameter;</td>
<td>dump</td>
</tr>
<tr>
<td>type</td>
<td>//textarea[@name="field_my_text_content"]</td>
<td>${dump}</td>
</tr>
<tr>
<td>verifyElementPresent</td>
<td>//button[@class="save"]</td>
<td></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>//button[@class="save"]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[@class="transition_message"]</td>
<td></td>
</tr>
<tr>
<td>assertTextPresent</td>
<td>Data updated.</td>
<td></td>
</tr>
<!-- update 2nd output - template_test_book_output_expected_002_en_html -->
<tr>
<td>echo</td>
<td>update => template_test_lealflet_book_expected_002_en_html</td>
<td></td>
</tr>
<tr>
<td>verifyTextPresent</td>
<td>Web Pages</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[contains(text(), 'Web Pages')]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>records</td>
<td></td>
</tr>
<tr>
<td>type</td>
<td>name=listbox_reference</td>
<td>Template.Test.Book</td>
</tr>
<tr>
<td>type</td>
<td>name=listbox_version</td>
<td>001</td>
</tr>
<tr>
<td>keyPressAndWait</td>
<td>listbox_version</td>
<td>\13</td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Template Test Book</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[contains(text(), 'Template.Test.Book')]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Short Title</td>
<td></td>
</tr>
<!-- don't save once to set modification date for live tests, because this
will up revision and it's the second time this document is used, so
revision on prior tests using this web page will be off by 1
<tr>
<td>waitForElementPresent</td>
<td>//button[@class="save"]</td>
<td></td>
</tr>
<tr>
<td>verifyElementPresent</td>
<td>//button[@class="save"]</td>
<td></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>//button[@class="save"]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[@class="transition_message"]</td>
<td></td>
</tr>
<tr>
<td>assertTextPresent</td>
<td>Data updated.</td>
<td></td>
</tr>
-->
<tr>
<td>waitForElementPresent</td>
<td>//button[@class="import_export"]</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//button[@class="import_export"]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Export Slideshow</td>
<td></td>
</tr>
<tr>
<td>selectAndWait</td>
<td>name=select_dialog</td>
<td>index=3</td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Export Book</td>
<td></td>
</tr>
<!-- Base_callDialogMethod max 2000 chars for url_params_string fails here -->
<tr>
<td>type</td>
<td>name=field_override_logo_reference</td>
<td>Template.Test.Image.Erp5.Logo</td>
</tr>
<tr>
<td>clickAndWait</td>
<td>name=Base_showUpdateDialog:method</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[@class="transition_message"]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Preview updated.</td>
<td></td>
</tr>
<tr>
<td>check</td>
<td>name=field_include_history_table</td>
<td></td>
</tr>
<tr>
<td>check</td>
<td>name=field_include_content_table</td>
<td></td>
</tr>
<tr>
<td>check</td>
<td>name=field_include_reference_table</td>
<td></td>
</tr>
<tr>
<td>check</td>
<td>name=field_include_linked_content</td>
<td></td>
</tr>
<tr>
<td>check</td>
<td>name=field_include_report_content</td>
<td></td>
</tr>
<tr>
<td>type</td>
<td>name=field_override_document_description</td>
<td>foobar</td>
</tr>
<tr>
<td>type</td>
<td>name=field_override_document_title</td>
<td>Couscous</td>
</tr>
<tr>
<td>type</td>
<td>name=field_override_document_short_title</td>
<td>Cous</td>
</tr>
<tr>
<td>type</td>
<td>name=field_override_document_reference</td>
<td>P-XYZ-Foobar</td>
</tr>
<tr>
<td>type</td>
<td>name=field_override_source_organisation_title</td>
<td>Test Organisation</td>
</tr>
<tr>
<td>type</td>
<td>name=field_override_source_person_title</td>
<td>Test Sender</td>
</tr>
<tr>
<td>type</td>
<td>name=field_override_document_version</td>
<td>333</td>
</tr>
<tr>
<td>clickAndWait</td>
<td>name=Base_callDialogMethod:method</td>
<td></td>
</tr>
<tr>
<td>waitForElementNotPresent</td>
<td>name=Base_callDialogMethod:method</td>
<td></td>
</tr>
<tr>
<td>waitForPageToLoad</td>
<td></td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>ISO 16016</td>
<td></td>
</tr>
<tr>
<td>storeLocation</td>
<td>url</td>
<td></td>
</tr>
<tr>
<td>echo</td>
<td>${url}</td>
<td></td>
</tr>
<!-- Can't fetch iframe source, so request page again -->
<tr>
<td>storeEval</td>
<td>function ajax(url) {var xhr = new XMLHttpRequest();return new Promise(function(resolve, reject) {var k;xhr.open("GET", url, true);xhr.addEventListener("load", function(e) {if (e.target.status >= 400) {return reject(e);}resolve(e);});xhr.addEventListener("error", reject);xhr.send();}, function() {xhr.abort();});};ajax(storedVars["url"] + "&amp;batch_mode=True");</td>
<td>page_source</td>
</tr>
<tr>
<td>goBackAndWait</td>
<td></td>
<td></td>
</tr>
<tr>
<td>waitForPageToLoad</td>
<td></td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Web Pages</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[contains(text(), 'Web Pages')]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>records</td>
<td></td>
</tr>
<tr>
<td>type</td>
<td>name=listbox_reference</td>
<td>%Template% AND %Output% AND %Book%</td>
</tr>
<tr>
<td>type</td>
<td>name=listbox_version</td>
<td>002</td>
</tr>
<tr>
<td>keyPressAndWait</td>
<td>listbox_reference</td>
<td>\13</td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Template.Test.Book.Expected.Output.Sample</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[contains(text(), 'Template.Test.Book.Expected.Output.Sample')]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Short Title</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//a/span[contains(text(), 'Edit')]</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a/span[contains(text(), 'Edit')]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//textarea[@name="field_my_text_content"]</td>
<td></td>
</tr>
<tr>
<td>storeEval</td>
<td>storedVars["page_source"].then(function (evt) {var content = evt.target.response || evt.target.responseText;document.getElementById("selenium_myiframe").contentDocument.body.bad_parameter = content;})</td>
<td></td>
</tr>
<tr>
<td>storeEval</td>
<td>document.getElementById("selenium_myiframe").contentDocument.body.bad_parameter;</td>
<td>dump</td>
</tr>
<tr>
<td>type</td>
<td>//textarea[@name="field_my_text_content"]</td>
<td>${dump}</td>
</tr>
<tr>
<td>verifyElementPresent</td>
<td>//button[@class="save"]</td>
<td></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>//button[@class="save"]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[@class="transition_message"]</td>
<td></td>
</tr>
<tr>
<td>assertTextPresent</td>
<td>Data updated.</td>
<td></td>
</tr>
<!-- update 3rd output - template_test_book_output_expected_003_de_html -->
<tr>
<td>echo</td>
<td>update => template_test_book_output_expected_003_de_html</td>
<td></td>
</tr>
<tr>
<td>verifyTextPresent</td>
<td>Web Pages</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[contains(text(), 'Web Pages')]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>records</td>
<td></td>
</tr>
<tr>
<td>type</td>
<td>name=listbox_reference</td>
<td>Template.Test.Book</td>
</tr>
<tr>
<td>type</td>
<td>name=listbox_version</td>
<td>002</td>
</tr>
<tr>
<td>keyPressAndWait</td>
<td>listbox_version</td>
<td>\13</td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Template Test Book</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[contains(text(), 'Template.Test.Book')]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Short Title</td>
<td></td>
</tr>
<!-- Save once to set modification date for live tests -->
<tr>
<td>waitForElementPresent</td>
<td>//button[@class="save"]</td>
<td></td>
</tr>
<tr>
<td>verifyElementPresent</td>
<td>//button[@class="save"]</td>
<td></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>//button[@class="save"]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[@class="transition_message"]</td>
<td></td>
</tr>
<tr>
<td>assertTextPresent</td>
<td>Data updated.</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//button[@class="import_export"]</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//button[@class="import_export"]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Export Slideshow</td>
<td></td>
</tr>
<tr>
<td>selectAndWait</td>
<td>name=select_dialog</td>
<td>index=3</td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Export Book</td>
<td></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>name=Base_showUpdateDialog:method</td>
<td></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>name=Base_showUpdateDialog:method</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[@class="transition_message"]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Preview updated.</td>
<td></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>name=Base_callDialogMethod:method</td>
<td></td>
</tr>
<tr>
<td>waitForPageToLoad</td>
<td></td>
<td></td>
</tr>
<tr>
<td>waitForElementNotPresent</td>
<td>name=Base_callDialogMethod:method</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>ISO 16016</td>
<td></td>
</tr>
<tr>
<td>storeLocation</td>
<td>url</td>
<td></td>
</tr>
<tr>
<td>echo</td>
<td>${url}</td>
<td></td>
</tr>
<!-- Can't fetch iframe source, so request page again -->
<tr>
<td>storeEval</td>
<td>function ajax(url) {var xhr = new XMLHttpRequest();return new Promise(function(resolve, reject) {var k;xhr.open("GET", url, true);xhr.addEventListener("load", function(e) {if (e.target.status >= 400) {return reject(e);}resolve(e);});xhr.addEventListener("error", reject);xhr.send();}, function() {xhr.abort();});};ajax(storedVars["url"] + "&amp;batch_mode=True");</td>
<td>page_source</td>
</tr>
<tr>
<td>goBackAndWait</td>
<td></td>
<td></td>
</tr>
<tr>
<td>waitForPageToLoad</td>
<td></td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Web Pages</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[contains(text(), 'Web Pages')]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>records</td>
<td></td>
</tr>
<tr>
<td>type</td>
<td>name=listbox_reference</td>
<td>%Template% AND %Output% AND %Book%</td>
</tr>
<tr>
<td>type</td>
<td>name=listbox_version</td>
<td>003</td>
</tr>
<tr>
<td>keyPressAndWait</td>
<td>listbox_reference</td>
<td>\13</td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Template.Test.Book.Expected.Output.Sample</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[contains(text(), 'Template.Test.Book.Expected.Output.Sample')]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Short Title</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//a/span[contains(text(), 'Edit')]</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a/span[contains(text(), 'Edit')]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//textarea[@name="field_my_text_content"]</td>
<td></td>
</tr>
<tr>
<td>storeEval</td>
<td>storedVars["page_source"].then(function (evt) {var content = evt.target.response || evt.target.responseText;document.getElementById("selenium_myiframe").contentDocument.body.bad_parameter = content;})</td>
<td></td>
</tr>
<tr>
<td>storeEval</td>
<td>document.getElementById("selenium_myiframe").contentDocument.body.bad_parameter;</td>
<td>dump</td>
</tr>
<tr>
<td>type</td>
<td>//textarea[@name="field_my_text_content"]</td>
<td>${dump}</td>
</tr>
<tr>
<td>verifyElementPresent</td>
<td>//button[@class="save"]</td>
<td></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>//button[@class="save"]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[@class="transition_message"]</td>
<td></td>
</tr>
<tr>
<td>assertTextPresent</td>
<td>Data updated.</td>
<td></td>
</tr>
<!-- Can't fetch iframe source, so request page again -->
<tr>
<td>storeEval</td>
<td>function ajax(url) {var xhr = new XMLHttpRequest();return new Promise(function(resolve, reject) {var k;xhr.open("GET", url, true);xhr.addEventListener("load", function(e) {if (e.target.status >= 400) {return reject(e);}resolve(e);});xhr.addEventListener("error", reject);xhr.send();}, function() {xhr.abort();});};ajax(storedVars["url"] + "&amp;batch_mode=True");</td>
<td>page_source</td>
</tr>
</tal:block>
<tr>
<td>goBackAndWait</td>
<td></td>
<td></td>
</tr>
<tr>
<td>waitForPageToLoad</td>
<td></td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Web Pages</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[contains(text(), 'Web Pages')]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>records</td>
<td></td>
</tr>
<tr>
<td>type</td>
<td>name=listbox_reference</td>
<td>%Template% AND %Output% AND %Book%</td>
</tr>
<tr>
<td>type</td>
<td>name=listbox_version</td>
<td>002</td>
</tr>
<tr>
<td>keyPressAndWait</td>
<td>listbox_reference</td>
<td>\13</td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Template.Test.Book.Expected.Output.Sample</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[contains(text(), 'Template.Test.Book.Expected.Output.Sample')]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Short Title</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//a/span[contains(text(), 'Edit')]</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a/span[contains(text(), 'Edit')]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[@class="input"]/div/textarea</td>
<td></td>
</tr>
<tal:block tal:condition="python: no_file_update == False">
<tr>
<td>storeEval</td>
<td>storedVars["page_source"].then(function (evt) {var content = evt.target.response || evt.target.responseText;document.getElementById("selenium_myiframe").contentDocument.body.bad_parameter = content;})</td>
<td></td>
</tr>
<tr>
<td>storeEval</td>
<td>document.getElementById("selenium_myiframe").contentDocument.body.bad_parameter;</td>
<td>dump</td>
</tr>
<tr>
<td>type</td>
<td>//div[@class="input"]/div/textarea</td>
<td>${dump}</td>
</tr>
</tal:block>
<tr>
<td>verifyElementPresent</td>
<td>//button[@class="save"]</td>
<td></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>//button[@class="save"]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[@class="transition_message"]</td>
<td></td>
</tr>
<tr>
<td>assertTextPresent</td>
<td>Data updated.</td>
<td></td>
</tr>
<!-- CASE 3: template_test_book_output_expected_003_de_html -->
<tr>
<td>echo</td>
<td>CASE 3 => template_test_book_output_expected_003_de_html</td>
<td></td>
</tr>
<tr>
<td>verifyTextPresent</td>
<td>Web Pages</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[contains(text(), 'Web Pages')]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>records</td>
<td></td>
</tr>
<tr>
<td>type</td>
<td>name=listbox_reference</td>
<td>Template.Test.Book</td>
</tr>
<tr>
<td>type</td>
<td>name=listbox_version</td>
<td>002</td>
</tr>
<tr>
<td>keyPressAndWait</td>
<td>listbox_version</td>
<td>\13</td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Template Test Book</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[contains(text(), 'Template.Test.Book')]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Short Title</td>
<td></td>
</tr>
<!-- Save once to set modification date for live tests -->
<tr>
<td>waitForElementPresent</td>
<td>//button[@class="save"]</td>
<td></td>
</tr>
<tr>
<td>verifyElementPresent</td>
<td>//button[@class="save"]</td>
<td></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>//button[@class="save"]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[@class="transition_message"]</td>
<td></td>
</tr>
<tr>
<td>assertTextPresent</td>
<td>Data updated.</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//button[@class="import_export"]</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//button[@class="import_export"]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Export Slideshow</td>
<td></td>
</tr>
<tr>
<td>selectAndWait</td>
<td>name=select_dialog</td>
<td>index=3</td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Export Book</td>
<td></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>name=Base_showUpdateDialog:method</td>
<td></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>name=Base_showUpdateDialog:method</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[@class="transition_message"]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Preview updated.</td>
<td></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>name=Base_callDialogMethod:method</td>
<td></td>
</tr>
<tr>
<td>waitForPageToLoad</td>
<td></td>
<td></td>
</tr>
<tr>
<td>waitForElementNotPresent</td>
<td>name=Base_callDialogMethod:method</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>ISO 16016</td>
<td></td>
</tr>
<tal:block tal:condition="python: no_file_update == False">
<tr>
<td>storeLocation</td>
<td>url</td>
<td></td>
</tr>
<tr>
<td>echo</td>
<td>${url}</td>
<td></td>
</tr>
<!-- update 1st pdf documents - template_test_book_input_001_en_pdf -->
<tr>
<td>echo</td>
<td>update => template_test_book_input_001_en_pdf</td>
<td></td>
</tr>
<tr>
<td>open</td>
<td>${base_url}/web_page_module/</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>records</td>
<td></td>
</tr>
<tr>
<td>type</td>
<td>name=listbox_reference</td>
<td>Template.Test.Book</td>
</tr>
<tr>
<td>type</td>
<td>name=listbox_version</td>
<td>001</td>
</tr>
<tr>
<td>keyPressAndWait</td>
<td>listbox_version</td>
<td>\13</td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Template Test Book</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[contains(text(), 'Template.Test.Book')]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Short Title</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//button[@class="import_export"]</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//button[@class="import_export"]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Export Slideshow</td>
<td></td>
</tr>
<tr>
<td>selectAndWait</td>
<td>name=select_dialog</td>
<td>index=3</td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Export Book</td>
<td></td>
</tr>
<tr>
<td>select</td>
<td>name=field_format</td>
<td>index=1</td>
</tr>
<tr>
<td>uncheck</td>
<td>name=field_include_content_table</td>
<td></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>name=Base_callDialogMethod:method</td>
<td></td>
</tr>
<tr>
<td>waitForPageToLoad</td>
<td></td>
<td></td>
</tr>
<!-- PDF viewer has no document.title, wait for "" means pdf is loaded -->
<tr>
<td>waitForTitle</td>
<td></td>
<td></td>
</tr>
<tr>
<td>verifyTitle</td>
<td></td>
<td></td>
</tr>
<!-- Store this location for re-requesting -->
<tr>
<td>storeLocation</td>
<td>url</td>
<td></td>
</tr>
<tr>
<td>echo</td>
<td>${url}</td>
<td></td>
</tr>
<!-- Can't access pdf source inside iframe, so request page again -->
<tr>
<td>storeEval</td>
<td>function ajax(url) { var xhr = new XMLHttpRequest(); return new Promise(function(resolve, reject) { var k; xhr.open("GET", url, true); xhr.responseType = "blob"; xhr.addEventListener("load", function(e) { if (e.target.status >= 400) { return reject(e); } resolve(e); }); xhr.addEventListener("error", reject); xhr.send(); }, function() { xhr.abort(); }); }; ajax(storedVars["url"] + "&amp;batch_mode=True");</td>
<td>pdf_source</td>
</tr>
<!-- pause to let the ajax request finish. now if the table was a async, queue
that would be nice-->
<tr>
<td>pause</td>
<td>3000</td>
<td></td>
</tr>
<tr>
<td>goBackAndWait</td>
<td></td>
<td></td>
</tr>
<tr>
<td>waitForPageToLoad</td>
<td></td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Web Pages</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[contains(text(), 'ERP5')]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//a[contains(text(), 'Documents')]</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[contains(text(), 'Documents')]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>records</td>
<td></td>
</tr>
<tr>
<td>type</td>
<td>name=listbox_reference</td>
<td>Template.Test.Book</td>
</tr>
<tr>
<td>type</td>
<td>name=listbox_version</td>
<td>001</td>
</tr>
<tr>
<td>keyPressAndWait</td>
<td>listbox_version</td>
<td>\13</td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Template Test Book</td>
<td></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>//a[contains(text(), 'Template.Test.Book')]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Short Title</td>
<td></td>
</tr>
<!-- manual form submit -->
<tr>
<td>storeLocation</td>
<td>url</td>
<td></td>
</tr>
<!-- only handle pdf_source (a promise!) here, because it needs to be set on
the iframe and a page-reload resets all (bad) parameters manually set -->
<tr>
<td>storeEval</td>
<td>storedVars["pdf_source"].then(function (evt) {document.getElementById("selenium_myiframe").contentDocument.body.bad_pdf_parameter = new Blob([evt.target.response || evt.target.responseText], {"type": evt.target.getResponseHeader("Content-Type")});});</td>
<td></td>
</tr>
<tr>
<td>storeEval</td>
<td>document.getElementById("selenium_myiframe").contentDocument.body.bad_pdf_parameter</td>
<td>pdf_dump</td>
</tr>
<tr>
<td>echo</td>
<td>${pdf_dump}</td>
<td></td>
</tr>
<tr>
<td>verifyNotExpression</td>
<td>${pdf_dump}</td>
<td>null</td>
</tr>
<tr>
<td>storeEval</td>
<td>function ajax(url, param) { var xhr = new XMLHttpRequest(); return new Promise(function(resolve, reject) { var k; xhr.open("POST", url, true); xhr.responseType = param.dataType || ""; if (typeof param.headers === 'object' &amp;&amp; param.headers !== null) { for (k in param.headers) { if (param.headers.hasOwnProperty(k)) { xhr.setRequestHeader(k, param.headers[k]); } } } xhr.addEventListener("load", function(e) { if (e.target.status >= 400) { return reject(e); } resolve(e); }); xhr.addEventListener("error", reject); if (typeof param.xhrFields === 'object' &amp;&amp; param.xhrFields !== null) { for (k in param.xhrFields) { if (param.xhrFields.hasOwnProperty(k)) { xhr[k] = param.xhrFields[k]; } } } xhr.send(param.data); }, function() { xhr.abort(); }); } var form_data = new FormData(); form_data.append("field_my_file", storedVars["pdf_dump"], "Template.Test.Book-001-en.pdf"); form_data.append("form_id", "File_view"); x = ajax(storedVars["url"].split("?")[0] + "/Base_edit", {"xhrFields": {"with_credentials": true}, "data": form_data});</td>
<td>promise</td>
</tr>
<tr>
<td>storeEval</td>
<td>storedVars["promise"].then(function () {document.getElementById("selenium_myiframe").src=storedVars["url"].split("?")[0]+"/File_view?portal_status_message=Data%20updated."});</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[@class="transition_message"]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Data updated.</td>
<td></td>
</tr>
<!-- generate image - template_test_book_input_page_4_001_en_bmp -->
<tr>
<td>echo</td>
<td>update => template_test_book_input_page_4_001_en_bmp</td>
<td></td>
</tr>
<tr>
<td>storeEval</td>
<td>storedVars["url"].split("?")[0]</td>
<td>screenshot_url</td>
</tr>
<tr>
<td>echo</td>
<td>${screenshot_url}</td>
<td></td>
</tr>
<tr>
<td>open</td>
<td>${screenshot_url}/Document_createScreenshot?frame=4&amp;doc_id=template_test_book_input_page_4_001_en_bmp</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Screenshot updated.</td>
<td></td>
</tr>
<!-- update 2nd pdf document - template_test_book_input_002_en_pdf -->
<tr>
<td>echo</td>
<td>update => template_test_book_input_002_en_pdf</td>
<td></td>
</tr>
<tr>
<td>open</td>
<td>${base_url}/web_page_module/</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>records</td>
<td></td>
</tr>
<tr>
<td>type</td>
<td>name=listbox_reference</td>
<td>Template.Test.Book</td>
</tr>
<tr>
<td>type</td>
<td>name=listbox_version</td>
<td>001</td>
</tr>
<tr>
<td>keyPressAndWait</td>
<td>listbox_version</td>
<td>\13</td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Template Test Book</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[contains(text(), 'Template.Test.Book')]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Short Title</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//button[@class="import_export"]</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//button[@class="import_export"]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Export Slideshow</td>
<td></td>
</tr>
<tr>
<td>selectAndWait</td>
<td>name=select_dialog</td>
<td>index=3</td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Export Book</td>
<td></td>
</tr>
<tr>
<td>select</td>
<td>name=field_format</td>
<td>index=1</td>
</tr>
<tr>
<td>check</td>
<td>name=field_include_history_table</td>
<td></td>
</tr>
<tr>
<td>check</td>
<td>name=field_include_content_table</td>
<td></td>
</tr>
<tr>
<td>check</td>
<td>name=field_include_reference_table</td>
<td></td>
</tr>
<tr>
<td>check</td>
<td>name=field_include_linked_content</td>
<td></td>
</tr>
<tr>
<td>check</td>
<td>name=field_include_report_content</td>
<td></td>
</tr>
<tr>
<td>type</td>
<td>name=field_override_document_description</td>
<td>foobar</td>
</tr>
<tr>
<td>type</td>
<td>name=field_override_document_title</td>
<td>Couscous</td>
</tr>
<tr>
<td>type</td>
<td>name=field_override_document_short_title</td>
<td>Cous</td>
</tr>
<tr>
<td>type</td>
<td>name=field_override_document_reference</td>
<td>P-XYZ-Foobar</td>
</tr>
<tr>
<td>type</td>
<td>name=field_override_logo_reference</td>
<td>Template.Test.Image.Erp5.Logo</td>
</tr>
<tr>
<td>type</td>
<td>name=field_override_source_organisation_title</td>
<td>Test Organisation</td>
</tr>
<tr>
<td>type</td>
<td>name=field_override_source_person_title</td>
<td>Test Sender</td>
</tr>
<tr>
<td>type</td>
<td>name=field_override_document_version</td>
<td>333</td>
</tr>
<!-- update dialog fails if param-string is larger than 2000 chars (here) -->
<tr>
<td>clickAndWait</td>
<td>name=Base_callDialogMethod:method</td>
<td></td>
</tr>
<tr>
<td>waitForPageToLoad</td>
<td></td>
<td></td>
</tr>
<!-- PDF viewer has no document.title, wait for "" means pdf is loaded -->
<tr>
<td>waitForTitle</td>
<td></td>
<td></td>
</tr>
<tr>
<td>verifyTitle</td>
<td></td>
<td></td>
</tr>
<!-- Store this location for re-requesting -->
<tr>
<td>storeLocation</td>
<td>url</td>
<td></td>
</tr>
<tr>
<td>echo</td>
<td>${url}</td>
<td></td>
</tr>
<!-- Can't fetch pdf source, so request page again -->
<tr>
<td>storeEval</td>
<td>function ajax(url) { var xhr = new XMLHttpRequest(); return new Promise(function(resolve, reject) { var k; xhr.open("GET", url, true); xhr.responseType = "blob", xhr.addEventListener("load", function(e) { if (e.target.status >= 400) { return reject(e); } resolve(e); }); xhr.addEventListener("error", reject); xhr.send(); }, function() { xhr.abort(); }); }; ajax(storedVars["url"] + "&amp;batch_mode=True");</td>
<td>pdf_source</td>
</tr>
<!-- pause to let the ajax request finish. now if the table was a async, queue
that would be nice-->
<tr>
<td>pause</td>
<td>9000</td>
<td></td>
</tr>
<tr>
<td>goBackAndWait</td>
<td></td>
<td></td>
</tr>
<tr>
<td>waitForPageToLoad</td>
<td></td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Web Pages</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[contains(text(), 'ERP5')]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//a[contains(text(), 'Documents')]</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[contains(text(), 'Documents')]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>records</td>
<td></td>
</tr>
<tr>
<td>type</td>
<td>name=listbox_reference</td>
<td>Template.Test.Book</td>
</tr>
<tr>
<td>type</td>
<td>name=listbox_version</td>
<td>002</td>
</tr>
<tr>
<td>keyPressAndWait</td>
<td>listbox_version</td>
<td>\13</td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Template Test Book</td>
<td></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>//a[contains(text(), 'Template.Test.Book')]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Short Title</td>
<td></td>
</tr>
<!-- manual form submit -->
<tr>
<td>storeLocation</td>
<td>url</td>
<td></td>
</tr>
<!-- only handle pdf_source (a promise!) here, because it needs to be set on
the iframe and a page-reload resets all (bad) parameters manually set -->
<tr>
<td>storeEval</td>
<td>storedVars["pdf_source"].then(function (evt) {document.getElementById("selenium_myiframe").contentDocument.body.bad_pdf_parameter = new Blob([evt.target.response || evt.target.responseText], {"type": evt.target.getResponseHeader("Content-Type")});});</td>
<td></td>
</tr>
<tr>
<td>storeEval</td>
<td>document.getElementById("selenium_myiframe").contentDocument.body.bad_pdf_parameter</td>
<td>pdf_dump</td>
</tr>
<tr>
<td>echo</td>
<td>${pdf_dump}</td>
<td></td>
</tr>
<tr>
<td>verifyNotExpression</td>
<td>${pdf_dump}</td>
<td>null</td>
</tr>
<tr>
<td>storeEval</td>
<td>function ajax(url, param) { var xhr = new XMLHttpRequest(); return new Promise(function(resolve, reject) { var k; xhr.open("POST", url, true); xhr.responseType = param.dataType || ""; if (typeof param.headers === 'object' &amp;&amp; param.headers !== null) { for (k in param.headers) { if (param.headers.hasOwnProperty(k)) { xhr.setRequestHeader(k, param.headers[k]); } } } xhr.addEventListener("load", function(e) { if (e.target.status >= 400) { return reject(e); } resolve(e); }); xhr.addEventListener("error", reject); if (typeof param.xhrFields === 'object' &amp;&amp; param.xhrFields !== null) { for (k in param.xhrFields) { if (param.xhrFields.hasOwnProperty(k)) { xhr[k] = param.xhrFields[k]; } } } xhr.send(param.data); }, function() { xhr.abort(); }); } var form_data = new FormData(); form_data.append("field_my_file", storedVars["pdf_dump"], "P-XYZ-Foobar-333-en.pdf"); form_data.append("form_id", "File_view"); x = ajax(storedVars["url"].split("?")[0] + "/Base_edit", {"xhrFields": {"with_credentials": true}, "data": form_data});</td>
<td>promise</td>
</tr>
<tr>
<td>storeEval</td>
<td>storedVars["promise"].then(function () {document.getElementById("selenium_myiframe").src=storedVars["url"].split("?")[0]+"/File_view?portal_status_message=Data%20updated."});</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[@class="transition_message"]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Data updated.</td>
<td></td>
</tr>
<!-- generate images -
template_test_book_input_page_4_002_en_bmp
template_test_book_input_page_5_002_en_bmp
template_test_book_input_page_9_002_en_bmp
-->
<tr>
<td>echo</td>
<td>update => template_test_book_input_page_4_002_en_bmp</td>
<td></td>
</tr>
<tr>
<td>storeEval</td>
<td>storedVars["url"].split("?")[0]</td>
<td>screenshot_url</td>
</tr>
<tr>
<td>echo</td>
<td>${screenshot_url}</td>
<td></td>
</tr>
<tr>
<td>open</td>
<td>${screenshot_url}/Document_createScreenshot?frame=4&amp;doc_id=template_test_book_input_page_4_002_en_bmp</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Screenshot updated.</td>
<td></td>
</tr>
<tr>
<td>open</td>
<td>${screenshot_url}/Document_createScreenshot?frame=5&amp;doc_id=template_test_book_input_page_5_002_en_bmp</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Screenshot updated.</td>
<td></td>
</tr>
<tr>
<td>open</td>
<td>${screenshot_url}/Document_createScreenshot?frame=10&amp;doc_id=template_test_book_input_page_10_002_en_bmp</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Screenshot updated.</td>
<td></td>
</tr>
<!-- update 3rd pdf document - template_test_book_input_003_de_pdf -->
<tr>
<td>echo</td>
<td>update => template_test_book_input_003_de_pdf</td>
<td></td>
</tr>
<tr>
<td>open</td>
<td>${base_url}/web_page_module/</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>records</td>
<td></td>
</tr>
<tr>
<td>type</td>
<td>name=listbox_reference</td>
<td>Template.Test.Book</td>
</tr>
<tr>
<td>type</td>
<td>name=listbox_version</td>
<td>002</td>
</tr>
<tr>
<td>keyPressAndWait</td>
<td>listbox_version</td>
<td>\13</td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Template Test Book</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[contains(text(), 'Template.Test.Book')]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Short Title</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//button[@class="import_export"]</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//button[@class="import_export"]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Export Slideshow</td>
<td></td>
</tr>
<tr>
<td>selectAndWait</td>
<td>name=select_dialog</td>
<td>index=3</td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Export Book</td>
<td></td>
</tr>
<tr>
<td>select</td>
<td>name=field_format</td>
<td>index=1</td>
</tr>
<tr>
<td>clickAndWait</td>
<td>name=Base_callDialogMethod:method</td>
<td></td>
</tr>
<tr>
<td>waitForPageToLoad</td>
<td></td>
<td></td>
</tr>
<!-- PDF viewer has no document.title, wait for "" means pdf is loaded -->
<tr>
<td>waitForTitle</td>
<td></td>
<td></td>
</tr>
<tr>
<td>verifyTitle</td>
<td></td>
<td></td>
</tr>
<!-- Store this location for re-requesting -->
<tr>
<td>storeLocation</td>
<td>url</td>
<td></td>
</tr>
<tr>
<td>echo</td>
<td>${url}</td>
<td></td>
</tr>
<!-- Can't fetch pdf source, so request page again -->
<tr>
<td>storeEval</td>
<td>function ajax(url) { var xhr = new XMLHttpRequest(); return new Promise(function(resolve, reject) { var k; xhr.open("GET", url, true); xhr.responseType = "blob", xhr.addEventListener("load", function(e) { if (e.target.status >= 400) { return reject(e); } resolve(e); }); xhr.addEventListener("error", reject); xhr.send(); }, function() { xhr.abort(); }); }; ajax(storedVars["url"] + "&amp;batch_mode=True");</td>
<td>pdf_source</td>
</tr>
<!-- pause to let the ajax request finish. now if the table was a async, queue
that would be nice-->
<tr>
<td>pause</td>
<td>3000</td>
<td></td>
</tr>
<!-- Can't fetch iframe source, so request page again -->
<tr>
<td>storeEval</td>
<td>function ajax(url) {var xhr = new XMLHttpRequest();return new Promise(function(resolve, reject) {var k;xhr.open("GET", url, true);xhr.addEventListener("load", function(e) {if (e.target.status >= 400) {return reject(e);}resolve(e);});xhr.addEventListener("error", reject);xhr.send();}, function() {xhr.abort();});};ajax(storedVars["url"] + "&amp;batch_mode=True");</td>
<td>page_source</td>
</tr>
</tal:block>
<tr>
<td>goBackAndWait</td>
<td></td>
<td></td>
</tr>
<tr>
<td>waitForPageToLoad</td>
<td></td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Web Pages</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[contains(text(), 'Web Pages')]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>records</td>
<td></td>
</tr>
<tr>
<td>type</td>
<td>name=listbox_reference</td>
<td>%Template% AND %Output% AND %Book%</td>
</tr>
<tr>
<td>type</td>
<td>name=listbox_version</td>
<td>003</td>
</tr>
<tr>
<td>keyPressAndWait</td>
<td>listbox_reference</td>
<td>\13</td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Template.Test.Book.Expected.Output.Sample</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[contains(text(), 'Template.Test.Book.Expected.Output.Sample')]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Short Title</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//a/span[contains(text(), 'Edit')]</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a/span[contains(text(), 'Edit')]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[@class="input"]/div/textarea</td>
<td></td>
</tr>
<tal:block tal:condition="python: no_file_update == False">
<tr>
<td>storeEval</td>
<td>storedVars["page_source"].then(function (evt) {var content = evt.target.response || evt.target.responseText;document.getElementById("selenium_myiframe").contentDocument.body.bad_parameter = content;})</td>
<td></td>
</tr>
<tr>
<td>storeEval</td>
<td>document.getElementById("selenium_myiframe").contentDocument.body.bad_parameter;</td>
<td>dump</td>
</tr>
<tr>
<td>type</td>
<td>//div[@class="input"]/div/textarea</td>
<td>${dump}</td>
</tr>
</tal:block>
<tr>
<td>verifyElementPresent</td>
<td>//button[@class="save"]</td>
<td></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>//button[@class="save"]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[@class="transition_message"]</td>
<td></td>
</tr>
<tr>
<td>assertTextPresent</td>
<td>Data updated.</td>
<td></td>
</tr>
<!-- CASE 1 (pdf) - template_test_book_input_001_en_pdf -->
<tr>
<td>echo</td>
<td>CASE 1 (pdf) => template_test_book_input_001_en_pdf</td>
<td></td>
</tr>
<tr>
<td>open</td>
<td>${base_url}/web_page_module/</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>records</td>
<td></td>
</tr>
<tr>
<td>type</td>
<td>name=listbox_reference</td>
<td>Template.Test.Book</td>
</tr>
<tr>
<td>type</td>
<td>name=listbox_version</td>
<td>001</td>
</tr>
<tr>
<td>keyPressAndWait</td>
<td>listbox_version</td>
<td>\13</td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Template Test Book</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[contains(text(), 'Template.Test.Book')]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Short Title</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//button[@class="import_export"]</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//button[@class="import_export"]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Export Slideshow</td>
<td></td>
</tr>
<tr>
<td>selectAndWait</td>
<td>name=select_dialog</td>
<td>index=3</td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Export Book</td>
<td></td>
</tr>
<tr>
<td>select</td>
<td>name=field_format</td>
<td>index=1</td>
</tr>
<tr>
<td>uncheck</td>
<td>name=field_include_content_table</td>
<td></td>
</tr>
<tal:block tal:condition="python: no_file_update == False">
<!--
PDF viewer has no document.title, wait for "" means pdf is loaded
FIREFOX (51) will prompt to open PDF in new window = we're dead for now
-->
<tr>
<td>clickAndWait</td>
<td>name=Base_callDialogMethod:method</td>
<td></td>
</tr>
<tr>
<td>waitForPageToLoad</td>
<td></td>
<td></td>
</tr>
<tr>
<td>waitForTitle</td>
<td></td>
<td></td>
</tr>
<tr>
<td>verifyTitle</td>
<td></td>
<td></td>
</tr>
<tr>
<td>storeLocation</td>
<td>url</td>
<td></td>
</tr>
<tr>
<td>echo</td>
<td>${url}</td>
<td></td>
</tr>
<!-- Can't access pdf source inside iframe, so request page again -->
<tr>
<td>storeEval</td>
<td>function ajax(url) { var xhr = new XMLHttpRequest(); return new Promise(function(resolve, reject) { var k; xhr.open("GET", url, true); xhr.responseType = "blob"; xhr.addEventListener("load", function(e) { if (e.target.status >= 400) { return reject(e); } resolve(e); }); xhr.addEventListener("error", reject); xhr.send(); }, function() { xhr.abort(); }); }; ajax(storedVars["url"] + "&amp;batch_mode=True");</td>
<td>pdf_source</td>
</tr>
<!-- pause to let the ajax request finish. now if the table was a async, queue
that would be nice 3/6/9000 didn't work -->
<tr>
<td>pause</td>
<td>12000</td>
<td></td>
</tr>
<tr>
<td>goBackAndWait</td>
<td></td>
<td></td>
</tr>
<tr>
<td>waitForPageToLoad</td>
<td></td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Web Pages</td>
<td></td>
</tr>
</tal:block>
<tr>
<td>click</td>
<td>//a[contains(text(), 'ERP5')]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//a[contains(text(), 'Documents')]</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[contains(text(), 'Documents')]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>records</td>
<td></td>
</tr>
<tr>
<td>type</td>
<td>name=listbox_reference</td>
<td>Template.Test.Book</td>
</tr>
<tr>
<td>type</td>
<td>name=listbox_version</td>
<td>001</td>
</tr>
<tr>
<td>keyPressAndWait</td>
<td>listbox_version</td>
<td>\13</td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Template Test Book</td>
<td></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>//a[contains(text(), 'Template.Test.Book')]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Short Title</td>
<td></td>
</tr>
<tal:block tal:condition="python: no_file_update == False">
<!-- manual form submit -->
<tr>
<td>storeLocation</td>
<td>url</td>
<td></td>
</tr>
<!-- only handle pdf_source (a promise!) here, because it needs to be set on
the iframe and a page-reload resets all (bad) parameters manually set -->
<tr>
<td>storeEval</td>
<td>storedVars["pdf_source"].then(function (evt) {document.getElementById("selenium_myiframe").contentDocument.body.bad_pdf_parameter = new Blob([evt.target.response || evt.target.responseText], {"type": evt.target.getResponseHeader("Content-Type")});});</td>
<td></td>
</tr>
<tr>
<td>storeEval</td>
<td>document.getElementById("selenium_myiframe").contentDocument.body.bad_pdf_parameter</td>
<td>pdf_dump</td>
</tr>
<tr>
<td>echo</td>
<td>${pdf_dump}</td>
<td></td>
</tr>
<tr>
<td>verifyNotExpression</td>
<td>${pdf_dump}</td>
<td>null</td>
</tr>
<tr>
<td>storeEval</td>
<td>function ajax(url, param) { var xhr = new XMLHttpRequest(); return new Promise(function(resolve, reject) { var k; xhr.open("POST", url, true); xhr.responseType = param.dataType || ""; if (typeof param.headers === 'object' &amp;&amp; param.headers !== null) { for (k in param.headers) { if (param.headers.hasOwnProperty(k)) { xhr.setRequestHeader(k, param.headers[k]); } } } xhr.addEventListener("load", function(e) { if (e.target.status >= 400) { return reject(e); } resolve(e); }); xhr.addEventListener("error", reject); if (typeof param.xhrFields === 'object' &amp;&amp; param.xhrFields !== null) { for (k in param.xhrFields) { if (param.xhrFields.hasOwnProperty(k)) { xhr[k] = param.xhrFields[k]; } } } xhr.send(param.data); }, function() { xhr.abort(); }); } var form_data = new FormData(); form_data.append("field_my_file", storedVars["pdf_dump"], "Template.Test.Book-001-en.pdf"); form_data.append("form_id", "File_view"); x = ajax(storedVars["url"].split("?")[0] + "/Base_edit", {"xhrFields": {"with_credentials": true}, "data": form_data});</td>
<td>promise</td>
</tr>
<tr>
<td>storeEval</td>
<td>storedVars["promise"].then(function () {document.getElementById("selenium_myiframe").src=storedVars["url"].split("?")[0]+"/File_view?portal_status_message=Data%20updated."});</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[@class="transition_message"]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Data updated.</td>
<td></td>
</tr>
<!-- generate image - template_test_book_input_page_4_001_en_bmp -->
<tr>
<td>echo</td>
<td>update => template_test_book_input_page_4_001_en_bmp</td>
<td></td>
</tr>
<tr>
<td>storeEval</td>
<td>storedVars["url"].split("?")[0]</td>
<td>screenshot_url</td>
</tr>
<tr>
<td>echo</td>
<td>${screenshot_url}</td>
<td></td>
</tr>
<tr>
<td>open</td>
<td>${screenshot_url}/Document_createScreenshot?frame=4&amp;doc_id=template_test_book_input_page_4_001_en_bmp</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Screenshot updated.</td>
<td></td>
</tr>
</tal:block>
<!-- CASE 2 (pdf) - template_test_book_input_002_en_pdf -->
<tr>
<td>echo</td>
<td>CASE 2 (pdf) => template_test_book_input_002_en_pdf</td>
<td></td>
</tr>
<tr>
<td>open</td>
<td>${base_url}/web_page_module/</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>records</td>
<td></td>
</tr>
<tr>
<td>type</td>
<td>name=listbox_reference</td>
<td>Template.Test.Book</td>
</tr>
<tr>
<td>type</td>
<td>name=listbox_version</td>
<td>001</td>
</tr>
<tr>
<td>keyPressAndWait</td>
<td>listbox_version</td>
<td>\13</td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Template Test Book</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[contains(text(), 'Template.Test.Book')]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Short Title</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//button[@class="import_export"]</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//button[@class="import_export"]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Export Slideshow</td>
<td></td>
</tr>
<tr>
<td>selectAndWait</td>
<td>name=select_dialog</td>
<td>index=3</td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Export Book</td>
<td></td>
</tr>
<tr>
<td>select</td>
<td>name=field_format</td>
<td>index=1</td>
</tr>
<tr>
<td>check</td>
<td>name=field_include_history_table</td>
<td></td>
</tr>
<tr>
<td>check</td>
<td>name=field_include_content_table</td>
<td></td>
</tr>
<tr>
<td>check</td>
<td>name=field_include_reference_table</td>
<td></td>
</tr>
<tr>
<td>check</td>
<td>name=field_include_linked_content</td>
<td></td>
</tr>
<tr>
<td>check</td>
<td>name=field_include_report_content</td>
<td></td>
</tr>
<tr>
<td>type</td>
<td>name=field_override_document_description</td>
<td>foobar</td>
</tr>
<tr>
<td>type</td>
<td>name=field_override_document_title</td>
<td>Couscous</td>
</tr>
<tr>
<td>type</td>
<td>name=field_override_document_short_title</td>
<td>Cous</td>
</tr>
<tr>
<td>type</td>
<td>name=field_override_document_reference</td>
<td>P-XYZ-Foobar</td>
</tr>
<tr>
<td>type</td>
<td>name=field_override_logo_reference</td>
<td>Template.Test.Image.Erp5.Logo</td>
</tr>
<tr>
<td>type</td>
<td>name=field_override_source_organisation_title</td>
<td>Test Organisation</td>
</tr>
<tr>
<td>type</td>
<td>name=field_override_source_person_title</td>
<td>Test Sender</td>
</tr>
<tr>
<td>type</td>
<td>name=field_override_document_version</td>
<td>333</td>
</tr>
<tal:block tal:condition="python: no_file_update == False">
<!--
PDF viewer has no document.title, wait for "" means pdf is loaded
FIREFOX (51) will prompt to open PDF in new window = we're dead for now
-->
<!-- update dialog fails if param-string is larger than 2000 chars (here) -->
<tr>
<td>clickAndWait</td>
<td>name=Base_callDialogMethod:method</td>
<td></td>
</tr>
<tr>
<td>waitForPageToLoad</td>
<td></td>
<td></td>
</tr>
<tr>
<td>waitForTitle</td>
<td></td>
<td></td>
</tr>
<tr>
<td>verifyTitle</td>
<td></td>
<td></td>
</tr>
<tr>
<td>storeLocation</td>
<td>url</td>
<td></td>
</tr>
<tr>
<td>echo</td>
<td>${url}</td>
<td></td>
</tr>
<!-- Can't fetch pdf source, so request page again -->
<tr>
<td>storeEval</td>
<td>function ajax(url) { var xhr = new XMLHttpRequest(); return new Promise(function(resolve, reject) { var k; xhr.open("GET", url, true); xhr.responseType = "blob", xhr.addEventListener("load", function(e) { if (e.target.status >= 400) { return reject(e); } resolve(e); }); xhr.addEventListener("error", reject); xhr.send(); }, function() { xhr.abort(); }); }; ajax(storedVars["url"] + "&amp;batch_mode=True");</td>
<td>pdf_source</td>
</tr>
<!-- pause to let the ajax request finish. now if the table was a async, queue
that would be nice, 3/6/9000 didn't work -->
<tr>
<td>pause</td>
<td>12000</td>
<td></td>
</tr>
<tr>
<td>goBackAndWait</td>
<td></td>
<td></td>
</tr>
<tr>
<td>waitForPageToLoad</td>
<td></td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Web Pages</td>
<td></td>
</tr>
</tal:block>
<tr>
<td>click</td>
<td>//a[contains(text(), 'ERP5')]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//a[contains(text(), 'Documents')]</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[contains(text(), 'Documents')]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>records</td>
<td></td>
</tr>
<tr>
<td>type</td>
<td>name=listbox_reference</td>
<td>Template.Test.Book</td>
</tr>
<tr>
<td>type</td>
<td>name=listbox_version</td>
<td>002</td>
</tr>
<tr>
<td>keyPressAndWait</td>
<td>listbox_version</td>
<td>\13</td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Template Test Book</td>
<td></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>//a[contains(text(), 'Template.Test.Book')]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Short Title</td>
<td></td>
</tr>
<tal:block tal:condition="python: no_file_update == False">
<!-- manual form submit -->
<tr>
<td>storeLocation</td>
<td>url</td>
<td></td>
</tr>
<!-- only handle pdf_source (a promise!) here, because it needs to be set on
the iframe and a page-reload resets all (bad) parameters manually set -->
<tr>
<td>storeEval</td>
<td>storedVars["pdf_source"].then(function (evt) {document.getElementById("selenium_myiframe").contentDocument.body.bad_pdf_parameter = new Blob([evt.target.response || evt.target.responseText], {"type": evt.target.getResponseHeader("Content-Type")});});</td>
<td></td>
</tr>
<tr>
<td>storeEval</td>
<td>document.getElementById("selenium_myiframe").contentDocument.body.bad_pdf_parameter</td>
<td>pdf_dump</td>
</tr>
<tr>
<td>echo</td>
<td>${pdf_dump}</td>
<td></td>
</tr>
<tr>
<td>verifyNotExpression</td>
<td>${pdf_dump}</td>
<td>null</td>
</tr>
<tr>
<td>storeEval</td>
<td>function ajax(url, param) { var xhr = new XMLHttpRequest(); return new Promise(function(resolve, reject) { var k; xhr.open("POST", url, true); xhr.responseType = param.dataType || ""; if (typeof param.headers === 'object' &amp;&amp; param.headers !== null) { for (k in param.headers) { if (param.headers.hasOwnProperty(k)) { xhr.setRequestHeader(k, param.headers[k]); } } } xhr.addEventListener("load", function(e) { if (e.target.status >= 400) { return reject(e); } resolve(e); }); xhr.addEventListener("error", reject); if (typeof param.xhrFields === 'object' &amp;&amp; param.xhrFields !== null) { for (k in param.xhrFields) { if (param.xhrFields.hasOwnProperty(k)) { xhr[k] = param.xhrFields[k]; } } } xhr.send(param.data); }, function() { xhr.abort(); }); } var form_data = new FormData(); form_data.append("field_my_file", storedVars["pdf_dump"], "P-XYZ-Foobar-333-en.pdf"); form_data.append("form_id", "File_view"); x = ajax(storedVars["url"].split("?")[0] + "/Base_edit", {"xhrFields": {"with_credentials": true}, "data": form_data});</td>
<td>promise</td>
</tr>
<tr>
<td>storeEval</td>
<td>storedVars["promise"].then(function () {document.getElementById("selenium_myiframe").src=storedVars["url"].split("?")[0]+"/File_view?portal_status_message=Data%20updated."});</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[@class="transition_message"]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Data updated.</td>
<td></td>
</tr>
<!-- generate images -
template_test_book_input_page_4_002_en_bmp
template_test_book_input_page_5_002_en_bmp
template_test_book_input_page_9_002_en_bmp
-->
<tr>
<td>echo</td>
<td>update => template_test_book_input_page_4_002_en_bmp</td>
<td></td>
</tr>
<tr>
<td>storeEval</td>
<td>storedVars["url"].split("?")[0]</td>
<td>screenshot_url</td>
</tr>
<tr>
<td>echo</td>
<td>${screenshot_url}</td>
<td></td>
</tr>
<tr>
<td>open</td>
<td>${screenshot_url}/Document_createScreenshot?frame=4&amp;doc_id=template_test_book_input_page_4_002_en_bmp</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Screenshot updated.</td>
<td></td>
</tr>
<tr>
<td>open</td>
<td>${screenshot_url}/Document_createScreenshot?frame=5&amp;doc_id=template_test_book_input_page_5_002_en_bmp</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Screenshot updated.</td>
<td></td>
</tr>
<tr>
<td>open</td>
<td>${screenshot_url}/Document_createScreenshot?frame=10&amp;doc_id=template_test_book_input_page_10_002_en_bmp</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Screenshot updated.</td>
<td></td>
</tr>
</tal:block>
<!-- CASE 3 (pdf) - template_test_book_input_003_de_pdf -->
<tr>
<td>echo</td>
<td>CASE 3 (pdf) => template_test_book_input_003_de_pdf</td>
<td></td>
</tr>
<tr>
<td>open</td>
<td>${base_url}/web_page_module/</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>records</td>
<td></td>
</tr>
<tr>
<td>type</td>
<td>name=listbox_reference</td>
<td>Template.Test.Book</td>
</tr>
<tr>
<td>type</td>
<td>name=listbox_version</td>
<td>002</td>
</tr>
<tr>
<td>keyPressAndWait</td>
<td>listbox_version</td>
<td>\13</td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Template Test Book</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[contains(text(), 'Template.Test.Book')]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Short Title</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//button[@class="import_export"]</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//button[@class="import_export"]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Export Slideshow</td>
<td></td>
</tr>
<tr>
<td>selectAndWait</td>
<td>name=select_dialog</td>
<td>index=3</td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Export Book</td>
<td></td>
</tr>
<tr>
<td>select</td>
<td>name=field_format</td>
<td>index=1</td>
</tr>
<tal:block tal:condition="python: no_file_update == False">
<!--
PDF viewer has no document.title, wait for "" means pdf is loaded
FIREFOX (51) will prompt to open PDF in new window = we're dead for now
-->
<tr>
<td>clickAndWait</td>
<td>name=Base_callDialogMethod:method</td>
<td></td>
</tr>
<tr>
<td>waitForPageToLoad</td>
<td></td>
<td></td>
</tr>
<tr>
<td>waitForTitle</td>
<td></td>
<td></td>
</tr>
<tr>
<td>verifyTitle</td>
<td></td>
<td></td>
</tr>
<tr>
<td>storeLocation</td>
<td>url</td>
<td></td>
</tr>
<tr>
<td>echo</td>
<td>${url}</td>
<td></td>
</tr>
<tr>
<td>goBackAndWait</td>
<td></td>
<td></td>
</tr>
<tr>
<td>waitForPageToLoad</td>
<td></td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Web Pages</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[contains(text(), 'ERP5')]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//a[contains(text(), 'Documents')]</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[contains(text(), 'Documents')]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>records</td>
<td></td>
</tr>
<tr>
<td>type</td>
<td>name=listbox_reference</td>
<td>Template.Test.Book</td>
</tr>
<tr>
<td>type</td>
<td>name=listbox_version</td>
<td>003</td>
</tr>
<tr>
<td>keyPressAndWait</td>
<td>listbox_version</td>
<td>\13</td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Template Test Book</td>
<td></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>//a[contains(text(), 'Template.Test.Book')]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Short Title</td>
<td></td>
</tr>
<!-- manual form submit -->
<tr>
<td>storeLocation</td>
<td>url</td>
<td></td>
</tr>
<!-- only handle pdf_source (a promise!) here, because it needs to be set on
the iframe and a page-reload resets all (bad) parameters manually set -->
<tr>
<td>storeEval</td>
<td>storedVars["pdf_source"].then(function (evt) {document.getElementById("selenium_myiframe").contentDocument.body.bad_pdf_parameter = new Blob([evt.target.response || evt.target.responseText], {"type": evt.target.getResponseHeader("Content-Type")});});</td>
<td></td>
</tr>
<tr>
<td>storeEval</td>
<td>document.getElementById("selenium_myiframe").contentDocument.body.bad_pdf_parameter</td>
<td>pdf_dump</td>
</tr>
<tr>
<td>echo</td>
<td>${pdf_dump}</td>
<td></td>
</tr>
<tr>
<td>verifyNotExpression</td>
<td>${pdf_dump}</td>
<td>null</td>
</tr>
<tr>
<td>storeEval</td>
<td>function ajax(url, param) { var xhr = new XMLHttpRequest(); return new Promise(function(resolve, reject) { var k; xhr.open("POST", url, true); xhr.responseType = param.dataType || ""; if (typeof param.headers === 'object' &amp;&amp; param.headers !== null) { for (k in param.headers) { if (param.headers.hasOwnProperty(k)) { xhr.setRequestHeader(k, param.headers[k]); } } } xhr.addEventListener("load", function(e) { if (e.target.status >= 400) { return reject(e); } resolve(e); }); xhr.addEventListener("error", reject); if (typeof param.xhrFields === 'object' &amp;&amp; param.xhrFields !== null) { for (k in param.xhrFields) { if (param.xhrFields.hasOwnProperty(k)) { xhr[k] = param.xhrFields[k]; } } } xhr.send(param.data); }, function() { xhr.abort(); }); } var form_data = new FormData(); form_data.append("field_my_file", storedVars["pdf_dump"], "Template.Test.Book-003-de.pdf"); form_data.append("form_id", "File_view"); x = ajax(storedVars["url"].split("?")[0] + "/Base_edit", {"xhrFields": {"with_credentials": true}, "data": form_data});</td>
<td>promise</td>
</tr>
<tr>
<td>storeEval</td>
<td>storedVars["promise"].then(function () {document.getElementById("selenium_myiframe").src=storedVars["url"].split("?")[0]+"/File_view?portal_status_message=Data%20updated."});</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[@class="transition_message"]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Data updated.</td>
<td></td>
</tr>
<!-- Can't fetch pdf source, so request page again -->
<tr>
<td>storeEval</td>
<td>function ajax(url) { var xhr = new XMLHttpRequest(); return new Promise(function(resolve, reject) { var k; xhr.open("GET", url, true); xhr.responseType = "blob", xhr.addEventListener("load", function(e) { if (e.target.status >= 400) { return reject(e); } resolve(e); }); xhr.addEventListener("error", reject); xhr.send(); }, function() { xhr.abort(); }); }; ajax(storedVars["url"] + "&amp;batch_mode=True");</td>
<td>pdf_source</td>
</tr>
<!-- pause to let the ajax request finish. now if the table was a async, queue
that would be nice, 3/6/9000 didn't work -->
<tr>
<td>pause</td>
<td>12000</td>
<td></td>
</tr>
<tr>
<td>goBackAndWait</td>
<td></td>
<td></td>
</tr>
<tr>
<td>waitForPageToLoad</td>
<td></td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Web Pages</td>
<td></td>
</tr>
</tal:block>
<tr>
<td>click</td>
<td>//a[contains(text(), 'ERP5')]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//a[contains(text(), 'Documents')]</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[contains(text(), 'Documents')]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>records</td>
<td></td>
</tr>
<tr>
<td>type</td>
<td>name=listbox_reference</td>
<td>Template.Test.Book</td>
</tr>
<tr>
<td>type</td>
<td>name=listbox_version</td>
<td>003</td>
</tr>
<tr>
<td>keyPressAndWait</td>
<td>listbox_version</td>
<td>\13</td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Template Test Book</td>
<td></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>//a[contains(text(), 'Template.Test.Book')]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Short Title</td>
<td></td>
</tr>
<tal:block tal:condition="python: no_file_update == False">
<!-- manual form submit -->
<tr>
<td>storeLocation</td>
<td>url</td>
<td></td>
</tr>
<!-- only handle pdf_source (a promise!) here, because it needs to be set on
the iframe and a page-reload resets all (bad) parameters manually set -->
<tr>
<td>storeEval</td>
<td>storedVars["pdf_source"].then(function (evt) {document.getElementById("selenium_myiframe").contentDocument.body.bad_pdf_parameter = new Blob([evt.target.response || evt.target.responseText], {"type": evt.target.getResponseHeader("Content-Type")});});</td>
<td></td>
</tr>
<tr>
<td>storeEval</td>
<td>document.getElementById("selenium_myiframe").contentDocument.body.bad_pdf_parameter</td>
<td>pdf_dump</td>
</tr>
<tr>
<td>echo</td>
<td>${pdf_dump}</td>
<td></td>
</tr>
<tr>
<td>verifyNotExpression</td>
<td>${pdf_dump}</td>
<td>null</td>
</tr>
<tr>
<td>storeEval</td>
<td>function ajax(url, param) { var xhr = new XMLHttpRequest(); return new Promise(function(resolve, reject) { var k; xhr.open("POST", url, true); xhr.responseType = param.dataType || ""; if (typeof param.headers === 'object' &amp;&amp; param.headers !== null) { for (k in param.headers) { if (param.headers.hasOwnProperty(k)) { xhr.setRequestHeader(k, param.headers[k]); } } } xhr.addEventListener("load", function(e) { if (e.target.status >= 400) { return reject(e); } resolve(e); }); xhr.addEventListener("error", reject); if (typeof param.xhrFields === 'object' &amp;&amp; param.xhrFields !== null) { for (k in param.xhrFields) { if (param.xhrFields.hasOwnProperty(k)) { xhr[k] = param.xhrFields[k]; } } } xhr.send(param.data); }, function() { xhr.abort(); }); } var form_data = new FormData(); form_data.append("field_my_file", storedVars["pdf_dump"], "Template.Test.Book-003-de.pdf"); form_data.append("form_id", "File_view"); x = ajax(storedVars["url"].split("?")[0] + "/Base_edit", {"xhrFields": {"with_credentials": true}, "data": form_data});</td>
<td>promise</td>
</tr>
<tr>
<td>storeEval</td>
<td>storedVars["promise"].then(function () {document.getElementById("selenium_myiframe").src=storedVars["url"].split("?")[0]+"/File_view?portal_status_message=Data%20updated."});</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[@class="transition_message"]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Data updated.</td>
<td></td>
</tr>
<!-- generate image - template_test_book_input_page_1_003_de_bmp -->
<tr>
<td>echo</td>
<td>update => template_test_book_input_page_1_003_de_bmp</td>
<td></td>
</tr>
<tr>
<td>storeEval</td>
<td>storedVars["url"].split("?")[0]</td>
<td>screenshot_url</td>
</tr>
<tr>
<td>echo</td>
<td>${screenshot_url}</td>
<td></td>
</tr>
<tr>
<td>open</td>
<td>${screenshot_url}/Document_createScreenshot?frame=1&amp;doc_id=template_test_book_input_page_1_003_de_bmp</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Screenshot updated.</td>
<td></td>
</tr>
<!-- make sure print exchange works -->
<tr>
<td>echo</td>
<td>action => print</td>
<td></td>
</tr>
<tr>
<td>open</td>
<td>${base_url}/web_page_module/</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>records</td>
<td></td>
</tr>
<tr>
<td>type</td>
<td>name=listbox_reference</td>
<td>Template.Test.Book</td>
</tr>
<tr>
<td>type</td>
<td>name=listbox_version</td>
<td>001</td>
</tr>
<tr>
<td>keyPressAndWait</td>
<td>listbox_version</td>
<td>\13</td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Template Test Book</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[contains(text(), 'Template.Test.Book')]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Short Title</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//button[@class="print"]</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//button[@class="print"]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Print As Book</td>
<td></td>
</tr>
<tr>
<td>selectAndWait</td>
<td>name=select_dialog</td>
<td>index=3</td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Include History Table</td>
<td></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>name=Base_showUpdateDialog:method</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[@class="transition_message"]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Preview updated.</td>
<td></td>
</tr>
</tbody></table>
<!-- generate image - template_test_book_input_page_1_003_de_bmp -->
<tr>
<td>echo</td>
<td>update => template_test_book_input_page_1_003_de_bmp</td>
<td></td>
</tr>
<tr>
<td>storeEval</td>
<td>storedVars["url"].split("?")[0]</td>
<td>screenshot_url</td>
</tr>
<tr>
<td>echo</td>
<td>${screenshot_url}</td>
<td></td>
</tr>
<tr>
<td>open</td>
<td>${screenshot_url}/Document_createScreenshot?frame=1&amp;doc_id=template_test_book_input_page_1_003_de_bmp</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Screenshot updated.</td>
<td></td>
</tr>
</tal:block>
<!-- make sure print exchange works -->
<tr>
<td>echo</td>
<td>ACTION => PRINT</td>
<td></td>
</tr>
<tr>
<td>open</td>
<td>${base_url}/web_page_module/</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>records</td>
<td></td>
</tr>
<tr>
<td>type</td>
<td>name=listbox_reference</td>
<td>Template.Test.Book</td>
</tr>
<tr>
<td>type</td>
<td>name=listbox_version</td>
<td>001</td>
</tr>
<tr>
<td>keyPressAndWait</td>
<td>listbox_version</td>
<td>\13</td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Template Test Book</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[contains(text(), 'Template.Test.Book')]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Short Title</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//button[@class="print"]</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//button[@class="print"]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Print As Book</td>
<td></td>
</tr>
<tr>
<td>selectAndWait</td>
<td>name=select_dialog</td>
<td>index=3</td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Include History Table</td>
<td></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>name=Base_showUpdateDialog:method</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[@class="transition_message"]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Preview updated.</td>
<td></td>
</tr>
</tal:block>
</tbody>
</table>
</body>
</html>
\ No newline at end of file
......@@ -6,1726 +6,1792 @@
</head>
<body>
<!--
UPDATE comparison files for LIVE TESTS | DON'T RUN AUTOMATICALLY
(else tests will always pass...)
TEST UI and/or UPDATE FILES for live tests
This Zuite updates all test files (diff-html, pdfs, bmps) used in the LiveTests
based on the example web pages included in this bt5. Run this zuite after making
changes to the bt5 which will alter their look to automatically update all files
(else you need to do it by hand). This also means: DON'T RUN THIS AUTOMATICALLY,
because it will also update all test files with any errors you make, causing
liveTests to always pass (comparing wrong rendering to wrong test file).
This Zuite updates all test files (diff-html, pdfs, bmp) used in the LiveTests
based on the example web pages included in this bt5. The parameter no_file_update
determines whether files are updated (default True). To update test files,
create a script Zuite_setSkipSave in custom folder which returns False
Help:
http://www.seleniumhq.org/docs/02_selenium_ide.jsp#selenium-commands-selenese
http://seleniummaster.com/sitecontent/index.php/introduction-to-selenium-automation/selenium-ide/114-selenium-ide-complete-list-of-commands
Note:
# make sure to set editor to plain text in (erp5 test preferences)
# uses pause when updating files to wait for Cloudooo pdf rendering
# requires text-area editor
# test waitForTitle does not work in FF
-->
<table cellpadding="1" cellspacing="1" border="1">
<thead>
<tr><td rowspan="1" colspan="3">Test RenderJS UI</td></tr>
</thead><tbody>
<tal:block metal:use-macro="here/Zuite_CommonTemplate/macros/init" />
<tr><td rowspan="1" colspan="3">Test Leaflet Template UI</td></tr>
</thead>
<tbody>
<tal:block metal:use-macro="here/Zuite_CommonTemplate/macros/init" />
<tal:block tal:define="portal here/portal_url/getPortalObject;
caller python: getattr(context, 'Zuite_setSkipSave', None);
no_file_update python: caller() if caller is not None else True;">
<tr>
<td>open</td>
<td>${base_url}/bar_module/ListBoxZuite_reset</td>
<td></td>
</tr>
<tr>
<td>assertTextPresent</td>
<td>Reset Successfully.</td>
<td></td>
</tr>
<tr>
<td>open</td>
<td>${base_url}/Zuite_setPreferredTextEditor</td>
<td></td>
</tr>
<tr>
<td>assertTextPresent</td>
<td>Editor set to Textarea.</td>
<td></td>
</tr>
<tr>
<td>echo</td>
<td tal:content="python: ''.join(['skipping save: ', str(no_file_update)])"></td>
<td></td>
</tr>
<tal:block tal:condition="python: no_file_update == True">
<tr>
<td>open</td>
<td>${base_url}/Zuite_setConversionServerUrl</td>
<td></td>
</tr>
<tr>
<td>assertTextPresent</td>
<td>Conversion Server Url set.</td>
<td></td>
</tr>
</tal:block>
<tr>
<td>echo</td>
<td>ACTION => EXPORT</td>
<td></td>
</tr>
<!-- CASE 1 - template_test_lealflet_output_expected_001_en_html -->
<tr>
<td>echo</td>
<td>CASE 1 => template_test_lealflet_output_expected_001_en_html</td>
<td></td>
</tr>
<tr>
<td>open</td>
<td>${base_url}/web_page_module/</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>records</td>
<td></td>
</tr>
<tr>
<td>type</td>
<td>name=listbox_reference</td>
<td>Template.Test.Leaflet</td>
</tr>
<tr>
<td>type</td>
<td>name=listbox_version</td>
<td>001</td>
</tr>
<tr>
<td>keyPressAndWait</td>
<td>listbox_version</td>
<td>\13</td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Template Test Leaflet</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[contains(text(), 'Template.Test.Leaflet')]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Short Title</td>
<td></td>
</tr>
<!-- Save once to set modification date for live tests -->
<tr>
<td>waitForElementPresent</td>
<td>//button[@class="save"]</td>
<td></td>
</tr>
<tr>
<td>verifyElementPresent</td>
<td>//button[@class="save"]</td>
<td></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>//button[@class="save"]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[@class="transition_message"]</td>
<td></td>
</tr>
<tr>
<td>assertTextPresent</td>
<td>Data updated.</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//button[@class="import_export"]</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//button[@class="import_export"]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Export Slideshow</td>
<td></td>
</tr>
<tr>
<td>selectAndWait</td>
<td>name=select_dialog</td>
<td>index=2</td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Export Leaflet</td>
<td></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>name=Base_showUpdateDialog:method</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[@class="transition_message"]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Preview updated.</td>
<td></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>name=Base_callDialogMethod:method</td>
<td></td>
</tr>
<tr>
<td>waitForElementNotPresent</td>
<td>name=Base_callDialogMethod:method</td>
<td></td>
</tr>
<tr>
<td>waitForPageToLoad</td>
<td></td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>©</td>
<td></td>
</tr>
<tal:block tal:condition="python: no_file_update == False">
<tr>
<td>storeLocation</td>
<td>url</td>
<td></td>
</tr>
<tr>
<td>echo</td>
<td>${url}</td>
<td></td>
</tr>
<!-- Can't fetch iframe source, so request page again -->
<tr>
<td>storeEval</td>
<td>function ajax(url) {var xhr = new XMLHttpRequest();return new Promise(function(resolve, reject) {var k;xhr.open("GET", url, true);xhr.addEventListener("load", function(e) {if (e.target.status >= 400) {return reject(e);}resolve(e);});xhr.addEventListener("error", reject);xhr.send();}, function() {xhr.abort();});};ajax(storedVars["url"] + "&amp;batch_mode=True");</td>
<td>page_source</td>
</tr>
</tal:block>
<tr>
<td>goBackAndWait</td>
<td></td>
<td></td>
</tr>
<tr>
<td>waitForPageToLoad</td>
<td></td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Web Pages</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[contains(text(), 'Web Pages')]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>records</td>
<td></td>
</tr>
<tr>
<td>type</td>
<td>name=listbox_reference</td>
<td>%Template% AND %Output% AND %Leaflet%</td>
</tr>
<tr>
<td>type</td>
<td>name=listbox_version</td>
<td>001</td>
</tr>
<tr>
<td>keyPressAndWait</td>
<td>listbox_reference</td>
<td>\13</td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Template.Test.Leaflet.Expected.Output.Sample</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[contains(text(), 'Template.Test.Leaflet.Expected.Output.Sample')]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Short Title</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//a/span[contains(text(), 'Edit')]</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a/span[contains(text(), 'Edit')]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[@class="input"]/div/textarea</td>
<td></td>
</tr>
<tal:block tal:condition="python: no_file_update == False">
<tr>
<td>storeEval</td>
<td>storedVars["page_source"].then(function (evt) {var content = evt.target.response || evt.target.responseText;document.getElementById("selenium_myiframe").contentDocument.body.bad_parameter = content;})</td>
<td></td>
</tr>
<tr>
<td>storeEval</td>
<td>document.getElementById("selenium_myiframe").contentDocument.body.bad_parameter;</td>
<td>dump</td>
</tr>
<tr>
<td>type</td>
<td>//div[@class="input"]/div/textarea</td>
<td>${dump}</td>
</tr>
</tal:block>
<tr>
<td>verifyElementPresent</td>
<td>//button[@class="save"]</td>
<td></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>//button[@class="save"]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[@class="transition_message"]</td>
<td></td>
</tr>
<tr>
<td>assertTextPresent</td>
<td>Data updated.</td>
<td></td>
</tr>
<!-- CASE 2 - template_test_leaflet_output_expected_002_en_html -->
<tr>
<td>echo</td>
<td>CASE 2 => template_test_lealflet_output_expected_002_en_html</td>
<td></td>
</tr>
<tr>
<td>verifyTextPresent</td>
<td>Web Pages</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[contains(text(), 'Web Pages')]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>records</td>
<td></td>
</tr>
<tr>
<td>type</td>
<td>name=listbox_reference</td>
<td>Template.Test.Leaflet</td>
</tr>
<tr>
<td>type</td>
<td>name=listbox_version</td>
<td>001</td>
</tr>
<tr>
<td>keyPressAndWait</td>
<td>listbox_version</td>
<td>\13</td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Template Test Leaflet</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[contains(text(), 'Template.Test.Leaflet')]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Short Title</td>
<td></td>
</tr>
<!-- Save once to set modification date for live tests -->
<tr>
<td>waitForElementPresent</td>
<td>//button[@class="save"]</td>
<td></td>
</tr>
<tr>
<td>verifyElementPresent</td>
<td>//button[@class="save"]</td>
<td></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>//button[@class="save"]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[@class="transition_message"]</td>
<td></td>
</tr>
<tr>
<td>assertTextPresent</td>
<td>Data updated.</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//button[@class="import_export"]</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//button[@class="import_export"]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Export Slideshow</td>
<td></td>
</tr>
<tr>
<td>selectAndWait</td>
<td>name=select_dialog</td>
<td>index=2</td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Export Leaflet</td>
<td></td>
</tr>
<tr>
<td>type</td>
<td>name=field_override_source_organisation_title</td>
<td>Test Association</td>
</tr>
<tr>
<td>type</td>
<td>name=field_override_source_person_title</td>
<td>Test Recipient</td>
</tr>
<tr>
<td>type</td>
<td>name=field_override_leaflet_header_title</td>
<td>Couscous</td>
</tr>
<tr>
<td>uncheck</td>
<td>name=field_display_side</td>
<td></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>name=Base_showUpdateDialog:method</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[@class="transition_message"]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Preview updated.</td>
<td></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>name=Base_callDialogMethod:method</td>
<td></td>
</tr>
<tr>
<td>waitForPageToLoad</td>
<td></td>
<td></td>
</tr>
<tr>
<td>waitForElementNotPresent</td>
<td>name=Base_callDialogMethod:method</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>©</td>
<td></td>
</tr>
<tal:block tal:condition="python: no_file_update == False">
<tr>
<td>open</td>
<td>${base_url}/bar_module/ListBoxZuite_reset</td>
<td></td>
</tr>
<tr>
<td>assertTextPresent</td>
<td>Reset Successfully.</td>
<td></td>
</tr>
<!-- store url for re-requesting -->
<tr>
<td>storeLocation</td>
<td>url</td>
<td></td>
</tr>
<tr>
<td>echo</td>
<td>${url}</td>
<td></td>
</tr>
<!-- Can't fetch iframe source, so request page again -->
<tr>
<td>storeEval</td>
<td>function ajax(url) {var xhr = new XMLHttpRequest();return new Promise(function(resolve, reject) {var k;xhr.open("GET", url, true);xhr.addEventListener("load", function(e) {if (e.target.status >= 400) {return reject(e);}resolve(e);});xhr.addEventListener("error", reject);xhr.send();}, function() {xhr.abort();});};ajax(storedVars["url"] + "&amp;batch_mode=True");</td>
<td>page_source</td>
</tr>
</tal:block>
<tr>
<td>goBackAndWait</td>
<td></td>
<td></td>
</tr>
<tr>
<td>waitForPageToLoad</td>
<td></td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Web Pages</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[contains(text(), 'Web Pages')]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>records</td>
<td></td>
</tr>
<tr>
<td>type</td>
<td>name=listbox_reference</td>
<td>%Template% AND %Output% AND %Leaflet%</td>
</tr>
<tr>
<td>type</td>
<td>name=listbox_version</td>
<td>002</td>
</tr>
<tr>
<td>keyPressAndWait</td>
<td>listbox_reference</td>
<td>\13</td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Template.Test.Leaflet.Expected.Output.Sample</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[contains(text(), 'Template.Test.Leaflet.Expected.Output.Sample')]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Short Title</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//a/span[contains(text(), 'Edit')]</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a/span[contains(text(), 'Edit')]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[@class="input"]/div/textarea</td>
<td></td>
</tr>
<tal:block tal:condition="python: no_file_update == False">
<tr>
<td>storeEval</td>
<td>storedVars["page_source"].then(function (evt) {var content = evt.target.response || evt.target.responseText;document.getElementById("selenium_myiframe").contentDocument.body.bad_parameter = content;})</td>
<td></td>
</tr>
<tr>
<td>storeEval</td>
<td>document.getElementById("selenium_myiframe").contentDocument.body.bad_parameter;</td>
<td>dump</td>
</tr>
<tr>
<td>type</td>
<td>//div[@class="input"]/div/textarea</td>
<td>${dump}</td>
</tr>
</tal:block>
<tr>
<td>verifyElementPresent</td>
<td>//button[@class="save"]</td>
<td></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>//button[@class="save"]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[@class="transition_message"]</td>
<td></td>
</tr>
<tr>
<td>assertTextPresent</td>
<td>Data updated.</td>
<td></td>
</tr>
<!-- CASE 3 - template_test_leaflet_output_expected_003_de_html -->
<tr>
<td>echo</td>
<td>CASE 3 => template_test_leaflet_output_expected_003_de_html</td>
<td></td>
</tr>
<tr>
<td>verifyTextPresent</td>
<td>Web Pages</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[contains(text(), 'Web Pages')]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>records</td>
<td></td>
</tr>
<tr>
<td>type</td>
<td>name=listbox_reference</td>
<td>Template.Test.Leaflet</td>
</tr>
<tr>
<td>type</td>
<td>name=listbox_version</td>
<td>002</td>
</tr>
<tr>
<td>keyPressAndWait</td>
<td>listbox_version</td>
<td>\13</td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Template Test Leaflet</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[contains(text(), 'Template.Test.Leaflet')]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Short Title</td>
<td></td>
</tr>
<!-- Save once to set modification date for live tests -->
<tr>
<td>waitForElementPresent</td>
<td>//button[@class="save"]</td>
<td></td>
</tr>
<tr>
<td>verifyElementPresent</td>
<td>//button[@class="save"]</td>
<td></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>//button[@class="save"]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[@class="transition_message"]</td>
<td></td>
</tr>
<tr>
<td>assertTextPresent</td>
<td>Data updated.</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//button[@class="import_export"]</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//button[@class="import_export"]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Export Slideshow</td>
<td></td>
</tr>
<tr>
<td>selectAndWait</td>
<td>name=select_dialog</td>
<td>index=2</td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Export Leaflet</td>
<td></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>name=Base_showUpdateDialog:method</td>
<td></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>name=Base_showUpdateDialog:method</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[@class="transition_message"]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Preview updated.</td>
<td></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>name=Base_callDialogMethod:method</td>
<td></td>
</tr>
<tr>
<td>waitForPageToLoad</td>
<td></td>
<td></td>
</tr>
<tr>
<td>waitForElementNotPresent</td>
<td>name=Base_callDialogMethod:method</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>©</td>
<td></td>
</tr>
<tal:block tal:condition="python: no_file_update == False">
<!-- update 1st output - template_test_lealflet_output_expected_001_en_html -->
<tr>
<td>echo</td>
<td>action => export</td>
<td></td>
</tr>
<tr>
<td>echo</td>
<td>update => template_test_lealflet_output_expected_001_en_html</td>
<td></td>
</tr>
<tr>
<td>open</td>
<td>${base_url}/web_page_module/</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>records</td>
<td></td>
</tr>
<tr>
<td>type</td>
<td>name=listbox_reference</td>
<td>Template.Test.Leaflet</td>
</tr>
<tr>
<td>type</td>
<td>name=listbox_version</td>
<td>001</td>
</tr>
<tr>
<td>keyPressAndWait</td>
<td>listbox_version</td>
<td>\13</td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Template Test Leaflet</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[contains(text(), 'Template.Test.Leaflet')]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Short Title</td>
<td></td>
</tr>
<!-- Save once to set modification date for live tests -->
<tr>
<td>waitForElementPresent</td>
<td>//button[@class="save"]</td>
<td></td>
</tr>
<tr>
<td>verifyElementPresent</td>
<td>//button[@class="save"]</td>
<td></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>//button[@class="save"]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[@class="transition_message"]</td>
<td></td>
</tr>
<tr>
<td>assertTextPresent</td>
<td>Data updated.</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//button[@class="import_export"]</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//button[@class="import_export"]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Export Slideshow</td>
<td></td>
</tr>
<tr>
<td>selectAndWait</td>
<td>name=select_dialog</td>
<td>index=2</td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Export Leaflet</td>
<td></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>name=Base_showUpdateDialog:method</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[@class="transition_message"]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Preview updated.</td>
<td></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>name=Base_callDialogMethod:method</td>
<td></td>
</tr>
<tr>
<td>waitForElementNotPresent</td>
<td>name=Base_callDialogMethod:method</td>
<td></td>
</tr>
<tr>
<td>waitForPageToLoad</td>
<td></td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>©</td>
<td></td>
</tr>
<tr>
<td>storeLocation</td>
<td>url</td>
<td></td>
</tr>
<tr>
<td>echo</td>
<td>${url}</td>
<td></td>
</tr>
<!-- Can't fetch iframe source, so request page again -->
<tr>
<td>storeEval</td>
<td>function ajax(url) {var xhr = new XMLHttpRequest();return new Promise(function(resolve, reject) {var k;xhr.open("GET", url, true);xhr.addEventListener("load", function(e) {if (e.target.status >= 400) {return reject(e);}resolve(e);});xhr.addEventListener("error", reject);xhr.send();}, function() {xhr.abort();});};ajax(storedVars["url"] + "&amp;batch_mode=True");</td>
<td>page_source</td>
</tr>
<tr>
<td>goBackAndWait</td>
<td></td>
<td></td>
</tr>
<tr>
<td>waitForPageToLoad</td>
<td></td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Web Pages</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[contains(text(), 'Web Pages')]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>records</td>
<td></td>
</tr>
<tr>
<td>type</td>
<td>name=listbox_reference</td>
<td>%Template% AND %Output% AND %Leaflet%</td>
</tr>
<tr>
<td>type</td>
<td>name=listbox_version</td>
<td>001</td>
</tr>
<tr>
<td>keyPressAndWait</td>
<td>listbox_reference</td>
<td>\13</td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Template.Test.Leaflet.Expected.Output.Sample</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[contains(text(), 'Template.Test.Leaflet.Expected.Output.Sample')]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Short Title</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//a/span[contains(text(), 'Edit')]</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a/span[contains(text(), 'Edit')]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//textarea[@name="field_my_text_content"]</td>
<td></td>
</tr>
<tr>
<td>storeEval</td>
<td>storedVars["page_source"].then(function (evt) {var content = evt.target.response || evt.target.responseText;document.getElementById("selenium_myiframe").contentDocument.body.bad_parameter = content;})</td>
<td></td>
</tr>
<tr>
<td>storeEval</td>
<td>document.getElementById("selenium_myiframe").contentDocument.body.bad_parameter;</td>
<td>dump</td>
</tr>
<tr>
<td>type</td>
<td>//textarea[@name="field_my_text_content"]</td>
<td>${dump}</td>
</tr>
<tr>
<td>verifyElementPresent</td>
<td>//button[@class="save"]</td>
<td></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>//button[@class="save"]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[@class="transition_message"]</td>
<td></td>
</tr>
<tr>
<td>assertTextPresent</td>
<td>Data updated.</td>
<td></td>
</tr>
<!-- update 2nd output - template_test_leaflet_output_expected_002_en_html -->
<tr>
<td>echo</td>
<td>update => template_test_lealflet_output_expected_002_en_html</td>
<td></td>
</tr>
<tr>
<td>verifyTextPresent</td>
<td>Web Pages</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[contains(text(), 'Web Pages')]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>records</td>
<td></td>
</tr>
<tr>
<td>type</td>
<td>name=listbox_reference</td>
<td>Template.Test.Leaflet</td>
</tr>
<tr>
<td>type</td>
<td>name=listbox_version</td>
<td>001</td>
</tr>
<tr>
<td>keyPressAndWait</td>
<td>listbox_version</td>
<td>\13</td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Template Test Leaflet</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[contains(text(), 'Template.Test.Leaflet')]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Short Title</td>
<td></td>
</tr>
<!-- Save once to set modification date for live tests -->
<tr>
<td>waitForElementPresent</td>
<td>//button[@class="save"]</td>
<td></td>
</tr>
<tr>
<td>verifyElementPresent</td>
<td>//button[@class="save"]</td>
<td></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>//button[@class="save"]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[@class="transition_message"]</td>
<td></td>
</tr>
<tr>
<td>assertTextPresent</td>
<td>Data updated.</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//button[@class="import_export"]</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//button[@class="import_export"]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Export Slideshow</td>
<td></td>
</tr>
<tr>
<td>selectAndWait</td>
<td>name=select_dialog</td>
<td>index=2</td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Export Leaflet</td>
<td></td>
</tr>
<tr>
<td>type</td>
<td>name=field_override_source_organisation_title</td>
<td>Test Association</td>
</tr>
<tr>
<td>type</td>
<td>name=field_override_source_person_title</td>
<td>Test Recipient</td>
</tr>
<tr>
<td>type</td>
<td>name=field_override_leaflet_header_title</td>
<td>Couscous</td>
</tr>
<tr>
<td>uncheck</td>
<td>name=field_display_side</td>
<td></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>name=Base_showUpdateDialog:method</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[@class="transition_message"]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Preview updated.</td>
<td></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>name=Base_callDialogMethod:method</td>
<td></td>
</tr>
<tr>
<td>waitForPageToLoad</td>
<td></td>
<td></td>
</tr>
<tr>
<td>waitForElementNotPresent</td>
<td>name=Base_callDialogMethod:method</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>©</td>
<td></td>
</tr>
<tr>
<td>storeLocation</td>
<td>url</td>
<td></td>
</tr>
<tr>
<td>echo</td>
<td>${url}</td>
<td></td>
</tr>
<!-- Can't fetch iframe source, so request page again -->
<tr>
<td>storeEval</td>
<td>function ajax(url) {var xhr = new XMLHttpRequest();return new Promise(function(resolve, reject) {var k;xhr.open("GET", url, true);xhr.addEventListener("load", function(e) {if (e.target.status >= 400) {return reject(e);}resolve(e);});xhr.addEventListener("error", reject);xhr.send();}, function() {xhr.abort();});};ajax(storedVars["url"] + "&amp;batch_mode=True");</td>
<td>page_source</td>
</tr>
<tr>
<td>goBackAndWait</td>
<td></td>
<td></td>
</tr>
<tr>
<td>waitForPageToLoad</td>
<td></td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Web Pages</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[contains(text(), 'Web Pages')]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>records</td>
<td></td>
</tr>
<tr>
<td>type</td>
<td>name=listbox_reference</td>
<td>%Template% AND %Output% AND %Leaflet%</td>
</tr>
<tr>
<td>type</td>
<td>name=listbox_version</td>
<td>002</td>
</tr>
<tr>
<td>keyPressAndWait</td>
<td>listbox_reference</td>
<td>\13</td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Template.Test.Leaflet.Expected.Output.Sample</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[contains(text(), 'Template.Test.Leaflet.Expected.Output.Sample')]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Short Title</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//a/span[contains(text(), 'Edit')]</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a/span[contains(text(), 'Edit')]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//textarea[@name="field_my_text_content"]</td>
<td></td>
</tr>
<tr>
<td>storeEval</td>
<td>storedVars["page_source"].then(function (evt) {var content = evt.target.response || evt.target.responseText;document.getElementById("selenium_myiframe").contentDocument.body.bad_parameter = content;})</td>
<td></td>
</tr>
<tr>
<td>storeEval</td>
<td>document.getElementById("selenium_myiframe").contentDocument.body.bad_parameter;</td>
<td>dump</td>
</tr>
<tr>
<td>type</td>
<td>//textarea[@name="field_my_text_content"]</td>
<td>${dump}</td>
</tr>
<tr>
<td>verifyElementPresent</td>
<td>//button[@class="save"]</td>
<td></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>//button[@class="save"]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[@class="transition_message"]</td>
<td></td>
</tr>
<tr>
<td>assertTextPresent</td>
<td>Data updated.</td>
<td></td>
</tr>
<!-- update 3rd output - template_test_leaflet_output_expected_003_de_html -->
<tr>
<td>echo</td>
<td>update => template_test_leaflet_output_expected_003_de_html</td>
<td></td>
</tr>
<tr>
<td>verifyTextPresent</td>
<td>Web Pages</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[contains(text(), 'Web Pages')]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>records</td>
<td></td>
</tr>
<tr>
<td>type</td>
<td>name=listbox_reference</td>
<td>Template.Test.Leaflet</td>
</tr>
<tr>
<td>type</td>
<td>name=listbox_version</td>
<td>002</td>
</tr>
<tr>
<td>keyPressAndWait</td>
<td>listbox_version</td>
<td>\13</td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Template Test Leaflet</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[contains(text(), 'Template.Test.Leaflet')]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Short Title</td>
<td></td>
</tr>
<!-- Save once to set modification date for live tests -->
<tr>
<td>waitForElementPresent</td>
<td>//button[@class="save"]</td>
<td></td>
</tr>
<tr>
<td>verifyElementPresent</td>
<td>//button[@class="save"]</td>
<td></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>//button[@class="save"]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[@class="transition_message"]</td>
<td></td>
</tr>
<tr>
<td>assertTextPresent</td>
<td>Data updated.</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//button[@class="import_export"]</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//button[@class="import_export"]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Export Slideshow</td>
<td></td>
</tr>
<tr>
<td>selectAndWait</td>
<td>name=select_dialog</td>
<td>index=2</td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Export Leaflet</td>
<td></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>name=Base_showUpdateDialog:method</td>
<td></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>name=Base_showUpdateDialog:method</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[@class="transition_message"]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Preview updated.</td>
<td></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>name=Base_callDialogMethod:method</td>
<td></td>
</tr>
<tr>
<td>waitForPageToLoad</td>
<td></td>
<td></td>
</tr>
<tr>
<td>waitForElementNotPresent</td>
<td>name=Base_callDialogMethod:method</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>©</td>
<td></td>
</tr>
<tr>
<td>storeLocation</td>
<td>url</td>
<td></td>
</tr>
<tr>
<td>echo</td>
<td>${url}</td>
<td></td>
</tr>
<!-- Can't fetch iframe source, so request page again -->
<tr>
<td>storeEval</td>
<td>function ajax(url) {var xhr = new XMLHttpRequest();return new Promise(function(resolve, reject) {var k;xhr.open("GET", url, true);xhr.addEventListener("load", function(e) {if (e.target.status >= 400) {return reject(e);}resolve(e);});xhr.addEventListener("error", reject);xhr.send();}, function() {xhr.abort();});};ajax(storedVars["url"] + "&amp;batch_mode=True");</td>
<td>page_source</td>
</tr>
<tr>
<td>goBackAndWait</td>
<td></td>
<td></td>
</tr>
<tr>
<td>waitForPageToLoad</td>
<td></td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Web Pages</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[contains(text(), 'Web Pages')]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>records</td>
<td></td>
</tr>
<tr>
<td>type</td>
<td>name=listbox_reference</td>
<td>%Template% AND %Output% AND %Leaflet%</td>
</tr>
<tr>
<td>type</td>
<td>name=listbox_version</td>
<td>003</td>
</tr>
<tr>
<td>keyPressAndWait</td>
<td>listbox_reference</td>
<td>\13</td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Template.Test.Leaflet.Expected.Output.Sample</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[contains(text(), 'Template.Test.Leaflet.Expected.Output.Sample')]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Short Title</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//a/span[contains(text(), 'Edit')]</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a/span[contains(text(), 'Edit')]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//textarea[@name="field_my_text_content"]</td>
<td></td>
</tr>
<tr>
<td>storeEval</td>
<td>storedVars["page_source"].then(function (evt) {var content = evt.target.response || evt.target.responseText;document.getElementById("selenium_myiframe").contentDocument.body.bad_parameter = content;})</td>
<td></td>
</tr>
<tr>
<td>storeEval</td>
<td>document.getElementById("selenium_myiframe").contentDocument.body.bad_parameter;</td>
<td>dump</td>
</tr>
<tr>
<td>type</td>
<td>//textarea[@name="field_my_text_content"]</td>
<td>${dump}</td>
</tr>
<tr>
<td>verifyElementPresent</td>
<td>//button[@class="save"]</td>
<td></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>//button[@class="save"]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[@class="transition_message"]</td>
<td></td>
</tr>
<tr>
<td>assertTextPresent</td>
<td>Data updated.</td>
<td></td>
</tr>
<!-- update 1st pdf documents - template_test_leaflet_input_001_en_pdf -->
<tr>
<td>echo</td>
<td>update => template_test_leaflet_input_001_en_pdf</td>
<td></td>
</tr>
<tr>
<td>open</td>
<td>${base_url}/web_page_module/</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>records</td>
<td></td>
</tr>
<tr>
<td>type</td>
<td>name=listbox_reference</td>
<td>Template.Test.Leaflet</td>
</tr>
<tr>
<td>type</td>
<td>name=listbox_version</td>
<td>001</td>
</tr>
<tr>
<td>keyPressAndWait</td>
<td>listbox_version</td>
<td>\13</td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Template Test Leaflet</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[contains(text(), 'Template.Test.Leaflet')]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Short Title</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//button[@class="import_export"]</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//button[@class="import_export"]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Export Slideshow</td>
<td></td>
</tr>
<tr>
<td>selectAndWait</td>
<td>name=select_dialog</td>
<td>index=2</td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Export Leaflet</td>
<td></td>
</tr>
<tr>
<td>select</td>
<td>name=field_format</td>
<td>index=1</td>
</tr>
<tr>
<td>clickAndWait</td>
<td>name=Base_callDialogMethod:method</td>
<td></td>
</tr>
<tr>
<td>waitForPageToLoad</td>
<td></td>
<td></td>
</tr>
<!-- PDF viewer has no document.title, wait for "" means pdf is loaded -->
<tr>
<td>waitForTitle</td>
<td></td>
<td></td>
</tr>
<tr>
<td>verifyTitle</td>
<td></td>
<td></td>
</tr>
<!-- Store this location for re-requesting -->
<tr>
<td>storeLocation</td>
<td>url</td>
<td></td>
</tr>
<tr>
<td>echo</td>
<td>${url}</td>
<td></td>
</tr>
<!-- Can't access pdf source inside iframe, so request page again -->
<tr>
<td>storeEval</td>
<td>function ajax(url) { var xhr = new XMLHttpRequest(); return new Promise(function(resolve, reject) { var k; xhr.open("GET", url, true); xhr.responseType = "blob"; xhr.addEventListener("load", function(e) { if (e.target.status >= 400) { return reject(e); } resolve(e); }); xhr.addEventListener("error", reject); xhr.send(); }, function() { xhr.abort(); }); }; ajax(storedVars["url"] + "&amp;batch_mode=True");</td>
<td>pdf_source</td>
</tr>
<!-- pause to let the ajax request finish. now if the table was a async, queue
that would be nice, 3/6/9000 not enough-->
<tr>
<td>pause</td>
<td>12000</td>
<td></td>
</tr>
<tr>
<td>goBackAndWait</td>
<td></td>
<td></td>
</tr>
<tr>
<td>waitForPageToLoad</td>
<td></td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Web Pages</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[contains(text(), 'ERP5')]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//a[contains(text(), 'Documents')]</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[contains(text(), 'Documents')]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>records</td>
<td></td>
</tr>
<tr>
<td>type</td>
<td>name=listbox_reference</td>
<td>Template.Test.Leaflet</td>
</tr>
<tr>
<td>type</td>
<td>name=listbox_version</td>
<td>001</td>
</tr>
<tr>
<td>keyPressAndWait</td>
<td>listbox_version</td>
<td>\13</td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Template Test Leaflet</td>
<td></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>//a[contains(text(), 'Template.Test.Leaflet')]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Short Title</td>
<td></td>
</tr>
<!-- manual form submit -->
<tr>
<td>storeLocation</td>
<td>url</td>
<td></td>
</tr>
<!-- only handle pdf_source (a promise!) here, because it needs to be set on
the iframe and a page-reload resets all (bad) parameters manually set -->
<tr>
<td>storeEval</td>
<td>storedVars["pdf_source"].then(function (evt) {document.getElementById("selenium_myiframe").contentDocument.body.bad_pdf_parameter = new Blob([evt.target.response || evt.target.responseText], {"type": evt.target.getResponseHeader("Content-Type")});});</td>
<td></td>
</tr>
<tr>
<td>storeEval</td>
<td>document.getElementById("selenium_myiframe").contentDocument.body.bad_pdf_parameter</td>
<td>pdf_dump</td>
</tr>
<tr>
<td>echo</td>
<td>${pdf_dump}</td>
<td></td>
</tr>
<tr>
<td>verifyNotExpression</td>
<td>${pdf_dump}</td>
<td>null</td>
</tr>
<tr>
<td>storeEval</td>
<td>function ajax(url, param) { var xhr = new XMLHttpRequest(); return new Promise(function(resolve, reject) { var k; xhr.open("POST", url, true); xhr.responseType = param.dataType || ""; if (typeof param.headers === 'object' &amp;&amp; param.headers !== null) { for (k in param.headers) { if (param.headers.hasOwnProperty(k)) { xhr.setRequestHeader(k, param.headers[k]); } } } xhr.addEventListener("load", function(e) { if (e.target.status >= 400) { return reject(e); } resolve(e); }); xhr.addEventListener("error", reject); if (typeof param.xhrFields === 'object' &amp;&amp; param.xhrFields !== null) { for (k in param.xhrFields) { if (param.xhrFields.hasOwnProperty(k)) { xhr[k] = param.xhrFields[k]; } } } xhr.send(param.data); }, function() { xhr.abort(); }); } var form_data = new FormData(); form_data.append("field_my_file", storedVars["pdf_dump"], "Template.Test.Leaflet-001-en.pdf"); form_data.append("form_id", "File_view"); x = ajax(storedVars["url"].split("?")[0] + "/Base_edit", {"xhrFields": {"with_credentials": true}, "data": form_data});</td>
<td>promise</td>
</tr>
<tr>
<td>storeEval</td>
<td>storedVars["promise"].then(function () {document.getElementById("selenium_myiframe").src=storedVars["url"].split("?")[0]+"/File_view?portal_status_message=Data%20updated."});</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[@class="transition_message"]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Data updated.</td>
<td></td>
</tr>
<!-- generate image - template_test_leaflet_input_page_1_001_en_bmp -->
<tr>
<td>echo</td>
<td>update => template_test_leaflet_input_page_1_001_en_bmp</td>
<td></td>
</tr>
<tr>
<td>storeEval</td>
<td>storedVars["url"].split("?")[0]</td>
<td>screenshot_url</td>
</tr>
<tr>
<td>echo</td>
<td>${screenshot_url}</td>
<td></td>
</tr>
<tr>
<td>open</td>
<td>${screenshot_url}/Document_createScreenshot?frame=1&amp;doc_id=template_test_leaflet_input_page_1_001_en_bmp</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Screenshot updated.</td>
<td></td>
</tr>
<!-- update 2nd pdf document - template_test_leaflet_input_002_en_pdf -->
<tr>
<td>echo</td>
<td>update => template_test_leaflet_input_002_en_pdf</td>
<td></td>
</tr>
<tr>
<td>open</td>
<td>${base_url}/web_page_module/</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>records</td>
<td></td>
</tr>
<tr>
<td>type</td>
<td>name=listbox_reference</td>
<td>Template.Test.Leaflet</td>
</tr>
<tr>
<td>type</td>
<td>name=listbox_version</td>
<td>001</td>
</tr>
<tr>
<td>keyPressAndWait</td>
<td>listbox_version</td>
<td>\13</td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Template Test Leaflet</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[contains(text(), 'Template.Test.Leaflet')]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Short Title</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//button[@class="import_export"]</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//button[@class="import_export"]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Export Slideshow</td>
<td></td>
</tr>
<tr>
<td>selectAndWait</td>
<td>name=select_dialog</td>
<td>index=2</td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Export Leaflet</td>
<td></td>
</tr>
<tr>
<td>select</td>
<td>name=field_format</td>
<td>index=1</td>
</tr>
<tr>
<td>type</td>
<td>name=field_override_source_organisation_title</td>
<td>Test Association</td>
</tr>
<tr>
<td>type</td>
<td>name=field_override_source_person_title</td>
<td>Test Recipient</td>
</tr>
<tr>
<td>type</td>
<td>name=field_override_leaflet_header_title</td>
<td>Couscous</td>
</tr>
<tr>
<td>check</td>
<td>name=field_display_side</td>
<td></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>name=Base_callDialogMethod:method</td>
<td></td>
</tr>
<tr>
<td>waitForPageToLoad</td>
<td></td>
<td></td>
</tr>
<!-- PDF viewer has no document.title, wait for "" means pdf is loaded -->
<tr>
<td>waitForTitle</td>
<td></td>
<td></td>
</tr>
<tr>
<td>verifyTitle</td>
<td></td>
<td></td>
</tr>
<!-- Store this location for re-requesting -->
<tr>
<td>storeLocation</td>
<td>url</td>
<td></td>
</tr>
<tr>
<td>echo</td>
<td>${url}</td>
<td></td>
</tr>
<!-- Can't fetch pdf source, so request page again -->
<tr>
<td>storeEval</td>
<td>function ajax(url) { var xhr = new XMLHttpRequest(); return new Promise(function(resolve, reject) { var k; xhr.open("GET", url, true); xhr.responseType = "blob", xhr.addEventListener("load", function(e) { if (e.target.status >= 400) { return reject(e); } resolve(e); }); xhr.addEventListener("error", reject); xhr.send(); }, function() { xhr.abort(); }); }; ajax(storedVars["url"] + "&amp;batch_mode=True");</td>
<td>pdf_source</td>
</tr>
<!-- pause to let the ajax request finish. now if the table was a async, queue
that would be nice, 3/6000 did not work-->
<tr>
<td>pause</td>
<td>9000</td>
<td></td>
</tr>
<tr>
<td>goBackAndWait</td>
<td></td>
<td></td>
</tr>
<tr>
<td>waitForPageToLoad</td>
<td></td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Web Pages</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[contains(text(), 'ERP5')]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//a[contains(text(), 'Documents')]</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[contains(text(), 'Documents')]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>records</td>
<td></td>
</tr>
<tr>
<td>type</td>
<td>name=listbox_reference</td>
<td>Template.Test.Leaflet</td>
</tr>
<tr>
<td>type</td>
<td>name=listbox_version</td>
<td>002</td>
</tr>
<tr>
<td>keyPressAndWait</td>
<td>listbox_version</td>
<td>\13</td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Template Test Leaflet</td>
<td></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>//a[contains(text(), 'Template.Test.Leaflet')]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Short Title</td>
<td></td>
</tr>
<!-- manual form submit -->
<tr>
<td>storeLocation</td>
<td>url</td>
<td></td>
</tr>
<!-- only handle pdf_source (a promise!) here, because it needs to be set on
the iframe and a page-reload resets all (bad) parameters manually set -->
<tr>
<td>storeEval</td>
<td>storedVars["pdf_source"].then(function (evt) {document.getElementById("selenium_myiframe").contentDocument.body.bad_pdf_parameter = new Blob([evt.target.response || evt.target.responseText], {"type": evt.target.getResponseHeader("Content-Type")});});</td>
<td></td>
</tr>
<tr>
<td>storeEval</td>
<td>document.getElementById("selenium_myiframe").contentDocument.body.bad_pdf_parameter</td>
<td>pdf_dump</td>
</tr>
<tr>
<td>echo</td>
<td>${pdf_dump}</td>
<td></td>
</tr>
<tr>
<td>verifyNotExpression</td>
<td>${pdf_dump}</td>
<td>null</td>
</tr>
<tr>
<td>storeEval</td>
<td>function ajax(url, param) { var xhr = new XMLHttpRequest(); return new Promise(function(resolve, reject) { var k; xhr.open("POST", url, true); xhr.responseType = param.dataType || ""; if (typeof param.headers === 'object' &amp;&amp; param.headers !== null) { for (k in param.headers) { if (param.headers.hasOwnProperty(k)) { xhr.setRequestHeader(k, param.headers[k]); } } } xhr.addEventListener("load", function(e) { if (e.target.status >= 400) { return reject(e); } resolve(e); }); xhr.addEventListener("error", reject); if (typeof param.xhrFields === 'object' &amp;&amp; param.xhrFields !== null) { for (k in param.xhrFields) { if (param.xhrFields.hasOwnProperty(k)) { xhr[k] = param.xhrFields[k]; } } } xhr.send(param.data); }, function() { xhr.abort(); }); } var form_data = new FormData(); form_data.append("field_my_file", storedVars["pdf_dump"], "Template.Test.Leaflet-002-en.pdf"); form_data.append("form_id", "File_view"); x = ajax(storedVars["url"].split("?")[0] + "/Base_edit", {"xhrFields": {"with_credentials": true}, "data": form_data});</td>
<td>promise</td>
</tr>
<tr>
<td>storeEval</td>
<td>storedVars["promise"].then(function () {document.getElementById("selenium_myiframe").src=storedVars["url"].split("?")[0]+"/File_view?portal_status_message=Data%20updated."});</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[@class="transition_message"]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Data updated.</td>
<td></td>
</tr>
<!-- generate image - template_test_leaflet_input_page_0_002_en_bmp -->
<tr>
<td>echo</td>
<td>update => template_test_leaflet_input_page_0_002_en_bmp</td>
<td></td>
</tr>
<tr>
<td>storeEval</td>
<td>storedVars["url"].split("?")[0]</td>
<td>screenshot_url</td>
</tr>
<tr>
<td>echo</td>
<td>${screenshot_url}</td>
<td></td>
</tr>
<tr>
<td>open</td>
<td>${screenshot_url}/Document_createScreenshot?frame=0&amp;doc_id=template_test_leaflet_input_page_0_002_en_bmp</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Screenshot updated.</td>
<td></td>
</tr>
<!-- update 3rd pdf document - template_test_leaflet_input_003_de_pdf -->
<tr>
<td>echo</td>
<td>update => template_test_leaflet_input_003_de_pdf</td>
<td></td>
</tr>
<tr>
<td>open</td>
<td>${base_url}/web_page_module/</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>records</td>
<td></td>
</tr>
<tr>
<td>type</td>
<td>name=listbox_reference</td>
<td>Template.Test.Leaflet</td>
</tr>
<tr>
<td>type</td>
<td>name=listbox_version</td>
<td>002</td>
</tr>
<tr>
<td>keyPressAndWait</td>
<td>listbox_version</td>
<td>\13</td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Template Test Leaflet</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[contains(text(), 'Template.Test.Leaflet')]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Short Title</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//button[@class="import_export"]</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//button[@class="import_export"]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Export Slideshow</td>
<td></td>
</tr>
<tr>
<td>selectAndWait</td>
<td>name=select_dialog</td>
<td>index=2</td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Export Leaflet</td>
<td></td>
</tr>
<tr>
<td>select</td>
<td>name=field_format</td>
<td>index=1</td>
</tr>
<tr>
<td>clickAndWait</td>
<td>name=Base_callDialogMethod:method</td>
<td></td>
</tr>
<tr>
<td>waitForPageToLoad</td>
<td></td>
<td></td>
</tr>
<!-- PDF viewer has no document.title, wait for "" means pdf is loaded -->
<tr>
<td>waitForTitle</td>
<td></td>
<td></td>
</tr>
<tr>
<td>verifyTitle</td>
<td></td>
<td></td>
</tr>
<!-- Store this location for re-requesting -->
<tr>
<td>storeLocation</td>
<td>url</td>
<td></td>
</tr>
<tr>
<td>echo</td>
<td>${url}</td>
<td></td>
</tr>
<!-- Can't fetch pdf source, so request page again -->
<tr>
<td>storeEval</td>
<td>function ajax(url) { var xhr = new XMLHttpRequest(); return new Promise(function(resolve, reject) { var k; xhr.open("GET", url, true); xhr.responseType = "blob", xhr.addEventListener("load", function(e) { if (e.target.status >= 400) { return reject(e); } resolve(e); }); xhr.addEventListener("error", reject); xhr.send(); }, function() { xhr.abort(); }); }; ajax(storedVars["url"] + "&amp;batch_mode=True");</td>
<td>pdf_source</td>
</tr>
<!-- pause to let the ajax request finish. now if the table was a async, queue
that would be nice 3/6000 did not work-->
<tr>
<td>pause</td>
<td>9000</td>
<td></td>
</tr>
<tr>
<td>goBackAndWait</td>
<td></td>
<td></td>
</tr>
<tr>
<td>waitForPageToLoad</td>
<td></td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Web Pages</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[contains(text(), 'ERP5')]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//a[contains(text(), 'Documents')]</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[contains(text(), 'Documents')]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>records</td>
<td></td>
</tr>
<tr>
<td>type</td>
<td>name=listbox_reference</td>
<td>Template.Test.Leaflet</td>
</tr>
<tr>
<td>type</td>
<td>name=listbox_version</td>
<td>003</td>
</tr>
<tr>
<td>keyPressAndWait</td>
<td>listbox_version</td>
<td>\13</td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Template Test Leaflet</td>
<td></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>//a[contains(text(), 'Template.Test.Leaflet')]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Short Title</td>
<td></td>
</tr>
<!-- manual form submit -->
<tr>
<td>storeLocation</td>
<td>url</td>
<td></td>
</tr>
<!-- only handle pdf_source (a promise!) here, because it needs to be set on
the iframe and a page-reload resets all (bad) parameters manually set -->
<tr>
<td>storeEval</td>
<td>storedVars["pdf_source"].then(function (evt) {document.getElementById("selenium_myiframe").contentDocument.body.bad_pdf_parameter = new Blob([evt.target.response || evt.target.responseText], {"type": evt.target.getResponseHeader("Content-Type")});});</td>
<td></td>
</tr>
<tr>
<td>storeEval</td>
<td>document.getElementById("selenium_myiframe").contentDocument.body.bad_pdf_parameter</td>
<td>pdf_dump</td>
</tr>
<tr>
<td>echo</td>
<td>${pdf_dump}</td>
<td></td>
</tr>
<tr>
<td>verifyNotExpression</td>
<td>${pdf_dump}</td>
<td>null</td>
</tr>
<tr>
<td>storeEval</td>
<td>function ajax(url, param) { var xhr = new XMLHttpRequest(); return new Promise(function(resolve, reject) { var k; xhr.open("POST", url, true); xhr.responseType = param.dataType || ""; if (typeof param.headers === 'object' &amp;&amp; param.headers !== null) { for (k in param.headers) { if (param.headers.hasOwnProperty(k)) { xhr.setRequestHeader(k, param.headers[k]); } } } xhr.addEventListener("load", function(e) { if (e.target.status >= 400) { return reject(e); } resolve(e); }); xhr.addEventListener("error", reject); if (typeof param.xhrFields === 'object' &amp;&amp; param.xhrFields !== null) { for (k in param.xhrFields) { if (param.xhrFields.hasOwnProperty(k)) { xhr[k] = param.xhrFields[k]; } } } xhr.send(param.data); }, function() { xhr.abort(); }); } var form_data = new FormData(); form_data.append("field_my_file", storedVars["pdf_dump"], "Template.Test.Leaflet-003-de.pdf"); form_data.append("form_id", "File_view"); x = ajax(storedVars["url"].split("?")[0] + "/Base_edit", {"xhrFields": {"with_credentials": true}, "data": form_data});</td>
<td>promise</td>
</tr>
<tr>
<td>storeEval</td>
<td>storedVars["promise"].then(function () {document.getElementById("selenium_myiframe").src=storedVars["url"].split("?")[0]+"/File_view?portal_status_message=Data%20updated."});</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[@class="transition_message"]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Data updated.</td>
<td></td>
</tr>
<!-- generate image - template_test_leaflet_input_page_0_003_de_bmp -->
<tr>
<td>echo</td>
<td>update => template_test_leaflet_input_page_0_003_de_bmp</td>
<td></td>
</tr>
<tr>
<td>storeEval</td>
<td>storedVars["url"].split("?")[0]</td>
<td>screenshot_url</td>
</tr>
<tr>
<td>echo</td>
<td>${screenshot_url}</td>
<td></td>
</tr>
<tr>
<td>open</td>
<td>${screenshot_url}/Document_createScreenshot?frame=0&amp;doc_id=template_test_leaflet_input_page_0_003_de_bmp</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Screenshot updated.</td>
<td></td>
</tr>
<!-- make sure print exchange works -->
<tr>
<td>echo</td>
<td>action => print</td>
<td></td>
</tr>
<tr>
<td>open</td>
<td>${base_url}/web_page_module/</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>records</td>
<td></td>
</tr>
<tr>
<td>type</td>
<td>name=listbox_reference</td>
<td>Template.Test.Leaflet</td>
</tr>
<tr>
<td>type</td>
<td>name=listbox_version</td>
<td>001</td>
</tr>
<tr>
<td>keyPressAndWait</td>
<td>listbox_version</td>
<td>\13</td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Template Test Leaflet</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[contains(text(), 'Template.Test.Leaflet')]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Short Title</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//button[@class="print"]</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//button[@class="print"]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Print As Slideshow</td>
<td></td>
</tr>
<tr>
<td>selectAndWait</td>
<td>name=select_dialog</td>
<td>index=2</td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Display Side Panel</td>
<td></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>name=Base_showUpdateDialog:method</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[@class="transition_message"]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Preview updated.</td>
<td></td>
</tr>
</tbody></table>
<!-- store url for re-requesting -->
<tr>
<td>storeLocation</td>
<td>url</td>
<td></td>
</tr>
<tr>
<td>echo</td>
<td>${url}</td>
<td></td>
</tr>
<!-- Can't fetch iframe source, so request page again -->
<tr>
<td>storeEval</td>
<td>function ajax(url) {var xhr = new XMLHttpRequest();return new Promise(function(resolve, reject) {var k;xhr.open("GET", url, true);xhr.addEventListener("load", function(e) {if (e.target.status >= 400) {return reject(e);}resolve(e);});xhr.addEventListener("error", reject);xhr.send();}, function() {xhr.abort();});};ajax(storedVars["url"] + "&amp;batch_mode=True");</td>
<td>page_source</td>
</tr>
</tal:block>
<tr>
<td>goBackAndWait</td>
<td></td>
<td></td>
</tr>
<tr>
<td>waitForPageToLoad</td>
<td></td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Web Pages</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[contains(text(), 'Web Pages')]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>records</td>
<td></td>
</tr>
<tr>
<td>type</td>
<td>name=listbox_reference</td>
<td>%Template% AND %Output% AND %Leaflet%</td>
</tr>
<tr>
<td>type</td>
<td>name=listbox_version</td>
<td>003</td>
</tr>
<tr>
<td>keyPressAndWait</td>
<td>listbox_reference</td>
<td>\13</td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Template.Test.Leaflet.Expected.Output.Sample</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[contains(text(), 'Template.Test.Leaflet.Expected.Output.Sample')]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Short Title</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//a/span[contains(text(), 'Edit')]</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a/span[contains(text(), 'Edit')]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[@class="input"]/div/textarea</td>
<td></td>
</tr>
<tal:block tal:condition="python: no_file_update == False">
<tr>
<td>storeEval</td>
<td>storedVars["page_source"].then(function (evt) {var content = evt.target.response || evt.target.responseText;document.getElementById("selenium_myiframe").contentDocument.body.bad_parameter = content;})</td>
<td></td>
</tr>
<tr>
<td>storeEval</td>
<td>document.getElementById("selenium_myiframe").contentDocument.body.bad_parameter;</td>
<td>dump</td>
</tr>
<tr>
<td>type</td>
<td>//div[@class="input"]/div/textarea</td>
<td>${dump}</td>
</tr>
</tal:block>
<tr>
<td>verifyElementPresent</td>
<td>//button[@class="save"]</td>
<td></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>//button[@class="save"]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[@class="transition_message"]</td>
<td></td>
</tr>
<tr>
<td>assertTextPresent</td>
<td>Data updated.</td>
<td></td>
</tr>
<!-- CASE 1 (pdf) - template_test_leaflet_input_001_en_pdf -->
<tr>
<td>echo</td>
<td>CASE 1 (pdf) => template_test_leaflet_input_001_en_pdf</td>
<td></td>
</tr>
<tr>
<td>open</td>
<td>${base_url}/web_page_module/</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>records</td>
<td></td>
</tr>
<tr>
<td>type</td>
<td>name=listbox_reference</td>
<td>Template.Test.Leaflet</td>
</tr>
<tr>
<td>type</td>
<td>name=listbox_version</td>
<td>001</td>
</tr>
<tr>
<td>keyPressAndWait</td>
<td>listbox_version</td>
<td>\13</td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Template Test Leaflet</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[contains(text(), 'Template.Test.Leaflet')]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Short Title</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//button[@class="import_export"]</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//button[@class="import_export"]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Export Slideshow</td>
<td></td>
</tr>
<tr>
<td>selectAndWait</td>
<td>name=select_dialog</td>
<td>index=2</td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Export Leaflet</td>
<td></td>
</tr>
<tr>
<td>select</td>
<td>name=field_format</td>
<td>index=1</td>
</tr>
<tal:block tal:condition="python: no_file_update == False">
<!--
PDF viewer has no document.title, wait for "" means pdf is loaded
FIREFOX (51) will prompt to open PDF in new window = we're dead for now
-->
<tr>
<td>clickAndWait</td>
<td>name=Base_callDialogMethod:method</td>
<td></td>
</tr>
<tr>
<td>waitForPageToLoad</td>
<td></td>
<td></td>
</tr>
<tr>
<td>waitForTitle</td>
<td></td>
<td></td>
</tr>
<tr>
<td>verifyTitle</td>
<td></td>
<td></td>
</tr>
<tr>
<td>storeLocation</td>
<td>url</td>
<td></td>
</tr>
<tr>
<td>echo</td>
<td>${url}</td>
<td></td>
</tr>
<!-- Can't access pdf source inside iframe, so request page again -->
<tr>
<td>storeEval</td>
<td>function ajax(url) { var xhr = new XMLHttpRequest(); return new Promise(function(resolve, reject) { var k; xhr.open("GET", url, true); xhr.responseType = "blob"; xhr.addEventListener("load", function(e) { if (e.target.status >= 400) { return reject(e); } resolve(e); }); xhr.addEventListener("error", reject); xhr.send(); }, function() { xhr.abort(); }); }; ajax(storedVars["url"] + "&amp;batch_mode=True");</td>
<td>pdf_source</td>
</tr>
<!-- pause to let the ajax request finish. now if the table was a async, queue
that would be nice, 3/6/9000 not enough-->
<tr>
<td>pause</td>
<td>12000</td>
<td></td>
</tr>
<tr>
<td>goBackAndWait</td>
<td></td>
<td></td>
</tr>
<tr>
<td>waitForPageToLoad</td>
<td></td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Web Pages</td>
<td></td>
</tr>
</tal:block>
<tr>
<td>click</td>
<td>//a[contains(text(), 'ERP5')]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//a[contains(text(), 'Documents')]</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[contains(text(), 'Documents')]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>records</td>
<td></td>
</tr>
<tr>
<td>type</td>
<td>name=listbox_reference</td>
<td>Template.Test.Leaflet</td>
</tr>
<tr>
<td>type</td>
<td>name=listbox_version</td>
<td>001</td>
</tr>
<tr>
<td>keyPressAndWait</td>
<td>listbox_version</td>
<td>\13</td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Template Test Leaflet</td>
<td></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>//a[contains(text(), 'Template.Test.Leaflet')]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Short Title</td>
<td></td>
</tr>
<tal:block tal:condition="python: no_file_update == False">
<!-- manual form submit -->
<tr>
<td>storeLocation</td>
<td>url</td>
<td></td>
</tr>
<!-- only handle pdf_source (a promise!) here, because it needs to be set on
the iframe and a page-reload resets all (bad) parameters manually set -->
<tr>
<td>storeEval</td>
<td>storedVars["pdf_source"].then(function (evt) {document.getElementById("selenium_myiframe").contentDocument.body.bad_pdf_parameter = new Blob([evt.target.response || evt.target.responseText], {"type": evt.target.getResponseHeader("Content-Type")});});</td>
<td></td>
</tr>
<tr>
<td>storeEval</td>
<td>document.getElementById("selenium_myiframe").contentDocument.body.bad_pdf_parameter</td>
<td>pdf_dump</td>
</tr>
<tr>
<td>echo</td>
<td>${pdf_dump}</td>
<td></td>
</tr>
<tr>
<td>verifyNotExpression</td>
<td>${pdf_dump}</td>
<td>null</td>
</tr>
<tr>
<td>storeEval</td>
<td>function ajax(url, param) { var xhr = new XMLHttpRequest(); return new Promise(function(resolve, reject) { var k; xhr.open("POST", url, true); xhr.responseType = param.dataType || ""; if (typeof param.headers === 'object' &amp;&amp; param.headers !== null) { for (k in param.headers) { if (param.headers.hasOwnProperty(k)) { xhr.setRequestHeader(k, param.headers[k]); } } } xhr.addEventListener("load", function(e) { if (e.target.status >= 400) { return reject(e); } resolve(e); }); xhr.addEventListener("error", reject); if (typeof param.xhrFields === 'object' &amp;&amp; param.xhrFields !== null) { for (k in param.xhrFields) { if (param.xhrFields.hasOwnProperty(k)) { xhr[k] = param.xhrFields[k]; } } } xhr.send(param.data); }, function() { xhr.abort(); }); } var form_data = new FormData(); form_data.append("field_my_file", storedVars["pdf_dump"], "Template.Test.Leaflet-001-en.pdf"); form_data.append("form_id", "File_view"); x = ajax(storedVars["url"].split("?")[0] + "/Base_edit", {"xhrFields": {"with_credentials": true}, "data": form_data});</td>
<td>promise</td>
</tr>
<tr>
<td>storeEval</td>
<td>storedVars["promise"].then(function () {document.getElementById("selenium_myiframe").src=storedVars["url"].split("?")[0]+"/File_view?portal_status_message=Data%20updated."});</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[@class="transition_message"]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Data updated.</td>
<td></td>
</tr>
<!-- generate image - template_test_leaflet_input_page_1_001_en_bmp -->
<tr>
<td>echo</td>
<td>update => template_test_leaflet_input_page_1_001_en_bmp</td>
<td></td>
</tr>
<tr>
<td>storeEval</td>
<td>storedVars["url"].split("?")[0]</td>
<td>screenshot_url</td>
</tr>
<tr>
<td>echo</td>
<td>${screenshot_url}</td>
<td></td>
</tr>
<tr>
<td>open</td>
<td>${screenshot_url}/Document_createScreenshot?frame=1&amp;doc_id=template_test_leaflet_input_page_1_001_en_bmp</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Screenshot updated.</td>
<td></td>
</tr>
</tal:block>
<!-- CASE 2 (pdf) - template_test_leaflet_input_002_en_pdf -->
<tr>
<td>echo</td>
<td>CASE 2 (pdf) => template_test_leaflet_input_002_en_pdf</td>
<td></td>
</tr>
<tr>
<td>open</td>
<td>${base_url}/web_page_module/</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>records</td>
<td></td>
</tr>
<tr>
<td>type</td>
<td>name=listbox_reference</td>
<td>Template.Test.Leaflet</td>
</tr>
<tr>
<td>type</td>
<td>name=listbox_version</td>
<td>001</td>
</tr>
<tr>
<td>keyPressAndWait</td>
<td>listbox_version</td>
<td>\13</td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Template Test Leaflet</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[contains(text(), 'Template.Test.Leaflet')]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Short Title</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//button[@class="import_export"]</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//button[@class="import_export"]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Export Slideshow</td>
<td></td>
</tr>
<tr>
<td>selectAndWait</td>
<td>name=select_dialog</td>
<td>index=2</td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Export Leaflet</td>
<td></td>
</tr>
<tr>
<td>select</td>
<td>name=field_format</td>
<td>index=1</td>
</tr>
<tr>
<td>type</td>
<td>name=field_override_source_organisation_title</td>
<td>Test Association</td>
</tr>
<tr>
<td>type</td>
<td>name=field_override_source_person_title</td>
<td>Test Recipient</td>
</tr>
<tr>
<td>type</td>
<td>name=field_override_leaflet_header_title</td>
<td>Couscous</td>
</tr>
<tr>
<td>check</td>
<td>name=field_display_side</td>
<td></td>
</tr>
<tal:block tal:condition="python: no_file_update == False">
<!--
PDF viewer has no document.title, wait for "" means pdf is loaded
FIREFOX (51) will prompt to open PDF in new window = we're dead for now
-->
<tr>
<td>clickAndWait</td>
<td>name=Base_callDialogMethod:method</td>
<td></td>
</tr>
<tr>
<td>waitForPageToLoad</td>
<td></td>
<td></td>
</tr>
<tr>
<td>waitForTitle</td>
<td></td>
<td></td>
</tr>
<tr>
<td>verifyTitle</td>
<td></td>
<td></td>
</tr>
<tr>
<td>storeLocation</td>
<td>url</td>
<td></td>
</tr>
<tr>
<td>echo</td>
<td>${url}</td>
<td></td>
</tr>
<!-- Can't fetch pdf source, so request page again -->
<tr>
<td>storeEval</td>
<td>function ajax(url) { var xhr = new XMLHttpRequest(); return new Promise(function(resolve, reject) { var k; xhr.open("GET", url, true); xhr.responseType = "blob", xhr.addEventListener("load", function(e) { if (e.target.status >= 400) { return reject(e); } resolve(e); }); xhr.addEventListener("error", reject); xhr.send(); }, function() { xhr.abort(); }); }; ajax(storedVars["url"] + "&amp;batch_mode=True");</td>
<td>pdf_source</td>
</tr>
<!-- pause to let the ajax request finish. now if the table was a async, queue
that would be nice, 3/6000 did not work-->
<tr>
<td>pause</td>
<td>9000</td>
<td></td>
</tr>
<tr>
<td>goBackAndWait</td>
<td></td>
<td></td>
</tr>
<tr>
<td>waitForPageToLoad</td>
<td></td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Web Pages</td>
<td></td>
</tr>
</tal:block>
<tr>
<td>click</td>
<td>//a[contains(text(), 'ERP5')]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//a[contains(text(), 'Documents')]</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[contains(text(), 'Documents')]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>records</td>
<td></td>
</tr>
<tr>
<td>type</td>
<td>name=listbox_reference</td>
<td>Template.Test.Leaflet</td>
</tr>
<tr>
<td>type</td>
<td>name=listbox_version</td>
<td>002</td>
</tr>
<tr>
<td>keyPressAndWait</td>
<td>listbox_version</td>
<td>\13</td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Template Test Leaflet</td>
<td></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>//a[contains(text(), 'Template.Test.Leaflet')]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Short Title</td>
<td></td>
</tr>
<tal:block tal:condition="python: no_file_update == False">
<!-- manual form submit -->
<tr>
<td>storeLocation</td>
<td>url</td>
<td></td>
</tr>
<!-- only handle pdf_source (a promise!) here, because it needs to be set on
the iframe and a page-reload resets all (bad) parameters manually set -->
<tr>
<td>storeEval</td>
<td>storedVars["pdf_source"].then(function (evt) {document.getElementById("selenium_myiframe").contentDocument.body.bad_pdf_parameter = new Blob([evt.target.response || evt.target.responseText], {"type": evt.target.getResponseHeader("Content-Type")});});</td>
<td></td>
</tr>
<tr>
<td>storeEval</td>
<td>document.getElementById("selenium_myiframe").contentDocument.body.bad_pdf_parameter</td>
<td>pdf_dump</td>
</tr>
<tr>
<td>echo</td>
<td>${pdf_dump}</td>
<td></td>
</tr>
<tr>
<td>verifyNotExpression</td>
<td>${pdf_dump}</td>
<td>null</td>
</tr>
<tr>
<td>storeEval</td>
<td>function ajax(url, param) { var xhr = new XMLHttpRequest(); return new Promise(function(resolve, reject) { var k; xhr.open("POST", url, true); xhr.responseType = param.dataType || ""; if (typeof param.headers === 'object' &amp;&amp; param.headers !== null) { for (k in param.headers) { if (param.headers.hasOwnProperty(k)) { xhr.setRequestHeader(k, param.headers[k]); } } } xhr.addEventListener("load", function(e) { if (e.target.status >= 400) { return reject(e); } resolve(e); }); xhr.addEventListener("error", reject); if (typeof param.xhrFields === 'object' &amp;&amp; param.xhrFields !== null) { for (k in param.xhrFields) { if (param.xhrFields.hasOwnProperty(k)) { xhr[k] = param.xhrFields[k]; } } } xhr.send(param.data); }, function() { xhr.abort(); }); } var form_data = new FormData(); form_data.append("field_my_file", storedVars["pdf_dump"], "Template.Test.Leaflet-002-en.pdf"); form_data.append("form_id", "File_view"); x = ajax(storedVars["url"].split("?")[0] + "/Base_edit", {"xhrFields": {"with_credentials": true}, "data": form_data});</td>
<td>promise</td>
</tr>
<tr>
<td>storeEval</td>
<td>storedVars["promise"].then(function () {document.getElementById("selenium_myiframe").src=storedVars["url"].split("?")[0]+"/File_view?portal_status_message=Data%20updated."});</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[@class="transition_message"]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Data updated.</td>
<td></td>
</tr>
<!-- generate image - template_test_leaflet_input_page_0_002_en_bmp -->
<tr>
<td>echo</td>
<td>update => template_test_leaflet_input_page_0_002_en_bmp</td>
<td></td>
</tr>
<tr>
<td>storeEval</td>
<td>storedVars["url"].split("?")[0]</td>
<td>screenshot_url</td>
</tr>
<tr>
<td>echo</td>
<td>${screenshot_url}</td>
<td></td>
</tr>
<tr>
<td>open</td>
<td>${screenshot_url}/Document_createScreenshot?frame=0&amp;doc_id=template_test_leaflet_input_page_0_002_en_bmp</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Screenshot updated.</td>
<td></td>
</tr>
</tal:block>
<!-- CASE 3 (pdf) - template_test_leaflet_input_003_de_pdf -->
<tr>
<td>echo</td>
<td>CASE 3 (pdf) => template_test_leaflet_input_003_de_pdf</td>
<td></td>
</tr>
<tr>
<td>open</td>
<td>${base_url}/web_page_module/</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>records</td>
<td></td>
</tr>
<tr>
<td>type</td>
<td>name=listbox_reference</td>
<td>Template.Test.Leaflet</td>
</tr>
<tr>
<td>type</td>
<td>name=listbox_version</td>
<td>002</td>
</tr>
<tr>
<td>keyPressAndWait</td>
<td>listbox_version</td>
<td>\13</td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Template Test Leaflet</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[contains(text(), 'Template.Test.Leaflet')]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Short Title</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//button[@class="import_export"]</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//button[@class="import_export"]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Export Slideshow</td>
<td></td>
</tr>
<tr>
<td>selectAndWait</td>
<td>name=select_dialog</td>
<td>index=2</td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Export Leaflet</td>
<td></td>
</tr>
<tr>
<td>select</td>
<td>name=field_format</td>
<td>index=1</td>
</tr>
<tal:block tal:condition="python: no_file_update == False">
<!--
PDF viewer has no document.title, wait for "" means pdf is loaded
FIREFOX (51) will prompt to open PDF in new window = we're dead for now
-->
<tr>
<td>clickAndWait</td>
<td>name=Base_callDialogMethod:method</td>
<td></td>
</tr>
<tr>
<td>waitForPageToLoad</td>
<td></td>
<td></td>
</tr>
<tr>
<td>waitForTitle</td>
<td></td>
<td></td>
</tr>
<tr>
<td>verifyTitle</td>
<td></td>
<td></td>
</tr>
<tr>
<td>storeLocation</td>
<td>url</td>
<td></td>
</tr>
<tr>
<td>echo</td>
<td>${url}</td>
<td></td>
</tr>
<!-- Can't fetch pdf source, so request page again -->
<tr>
<td>storeEval</td>
<td>function ajax(url) { var xhr = new XMLHttpRequest(); return new Promise(function(resolve, reject) { var k; xhr.open("GET", url, true); xhr.responseType = "blob", xhr.addEventListener("load", function(e) { if (e.target.status >= 400) { return reject(e); } resolve(e); }); xhr.addEventListener("error", reject); xhr.send(); }, function() { xhr.abort(); }); }; ajax(storedVars["url"] + "&amp;batch_mode=True");</td>
<td>pdf_source</td>
</tr>
<!-- pause to let the ajax request finish. now if the table was a async, queue
that would be nice 3/6000 did not work-->
<tr>
<td>pause</td>
<td>9000</td>
<td></td>
</tr>
<tr>
<td>goBackAndWait</td>
<td></td>
<td></td>
</tr>
<tr>
<td>waitForPageToLoad</td>
<td></td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Web Pages</td>
<td></td>
</tr>
</tal:block>
<tr>
<td>click</td>
<td>//a[contains(text(), 'ERP5')]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//a[contains(text(), 'Documents')]</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[contains(text(), 'Documents')]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>records</td>
<td></td>
</tr>
<tr>
<td>type</td>
<td>name=listbox_reference</td>
<td>Template.Test.Leaflet</td>
</tr>
<tr>
<td>type</td>
<td>name=listbox_version</td>
<td>003</td>
</tr>
<tr>
<td>keyPressAndWait</td>
<td>listbox_version</td>
<td>\13</td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Template Test Leaflet</td>
<td></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>//a[contains(text(), 'Template.Test.Leaflet')]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Short Title</td>
<td></td>
</tr>
<tal:block tal:condition="python: no_file_update == False">
<!-- manual form submit -->
<tr>
<td>storeLocation</td>
<td>url</td>
<td></td>
</tr>
<!-- only handle pdf_source (a promise!) here, because it needs to be set on
the iframe and a page-reload resets all (bad) parameters manually set -->
<tr>
<td>storeEval</td>
<td>storedVars["pdf_source"].then(function (evt) {document.getElementById("selenium_myiframe").contentDocument.body.bad_pdf_parameter = new Blob([evt.target.response || evt.target.responseText], {"type": evt.target.getResponseHeader("Content-Type")});});</td>
<td></td>
</tr>
<tr>
<td>storeEval</td>
<td>document.getElementById("selenium_myiframe").contentDocument.body.bad_pdf_parameter</td>
<td>pdf_dump</td>
</tr>
<tr>
<td>echo</td>
<td>${pdf_dump}</td>
<td></td>
</tr>
<tr>
<td>verifyNotExpression</td>
<td>${pdf_dump}</td>
<td>null</td>
</tr>
<tr>
<td>storeEval</td>
<td>function ajax(url, param) { var xhr = new XMLHttpRequest(); return new Promise(function(resolve, reject) { var k; xhr.open("POST", url, true); xhr.responseType = param.dataType || ""; if (typeof param.headers === 'object' &amp;&amp; param.headers !== null) { for (k in param.headers) { if (param.headers.hasOwnProperty(k)) { xhr.setRequestHeader(k, param.headers[k]); } } } xhr.addEventListener("load", function(e) { if (e.target.status >= 400) { return reject(e); } resolve(e); }); xhr.addEventListener("error", reject); if (typeof param.xhrFields === 'object' &amp;&amp; param.xhrFields !== null) { for (k in param.xhrFields) { if (param.xhrFields.hasOwnProperty(k)) { xhr[k] = param.xhrFields[k]; } } } xhr.send(param.data); }, function() { xhr.abort(); }); } var form_data = new FormData(); form_data.append("field_my_file", storedVars["pdf_dump"], "Template.Test.Leaflet-003-de.pdf"); form_data.append("form_id", "File_view"); x = ajax(storedVars["url"].split("?")[0] + "/Base_edit", {"xhrFields": {"with_credentials": true}, "data": form_data});</td>
<td>promise</td>
</tr>
<tr>
<td>storeEval</td>
<td>storedVars["promise"].then(function () {document.getElementById("selenium_myiframe").src=storedVars["url"].split("?")[0]+"/File_view?portal_status_message=Data%20updated."});</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[@class="transition_message"]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Data updated.</td>
<td></td>
</tr>
<!-- generate image - template_test_leaflet_input_page_0_003_de_bmp -->
<tr>
<td>echo</td>
<td>update => template_test_leaflet_input_page_0_003_de_bmp</td>
<td></td>
</tr>
<tr>
<td>storeEval</td>
<td>storedVars["url"].split("?")[0]</td>
<td>screenshot_url</td>
</tr>
<tr>
<td>echo</td>
<td>${screenshot_url}</td>
<td></td>
</tr>
<tr>
<td>open</td>
<td>${screenshot_url}/Document_createScreenshot?frame=0&amp;doc_id=template_test_leaflet_input_page_0_003_de_bmp</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Screenshot updated.</td>
<td></td>
</tr>
</tal:block>
<!-- make sure print exchange works -->
<tr>
<td>echo</td>
<td>ACTION => PRINT</td>
<td></td>
</tr>
<tr>
<td>open</td>
<td>${base_url}/web_page_module/</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>records</td>
<td></td>
</tr>
<tr>
<td>type</td>
<td>name=listbox_reference</td>
<td>Template.Test.Leaflet</td>
</tr>
<tr>
<td>type</td>
<td>name=listbox_version</td>
<td>001</td>
</tr>
<tr>
<td>keyPressAndWait</td>
<td>listbox_version</td>
<td>\13</td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Template Test Leaflet</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[contains(text(), 'Template.Test.Leaflet')]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Short Title</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//button[@class="print"]</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//button[@class="print"]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Print As Slideshow</td>
<td></td>
</tr>
<tr>
<td>selectAndWait</td>
<td>name=select_dialog</td>
<td>index=2</td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Display Side Panel</td>
<td></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>name=Base_showUpdateDialog:method</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[@class="transition_message"]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Preview updated.</td>
<td></td>
</tr>
</tal:block>
</tbody>
</table>
</body>
</html>
\ No newline at end of file
......@@ -2,772 +2,837 @@
xmlns:metal="http://xml.zope.org/namespaces/metal">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Test and Update Test Files for LETTER EVENT Template</title>
<title>Test and Update Test Files for LETTER(EVENT) Template</title>
</head>
<body>
<!--
UPDATE comparison files for LIVE TESTS | DON'T RUN AUTOMATICALLY
(else tests will always pass...)
TEST UI and/or UPDATE FILES for live tests
This Zuite updates all test files (diff-html, pdfs, bmps) used in the LiveTests
based on the example web pages included in this bt5. Run this zuite after making
changes to the bt5 which will alter their look to automatically update all files
(else you need to do it by hand). This also means: DON'T RUN THIS AUTOMATICALLY,
because it will also update all test files with any errors you make, causing
liveTests to always pass (comparing wrong rendering to wrong test file).
This Zuite updates all test files (diff-html, pdfs, bmp) used in the LiveTests
based on the example web pages included in this bt5. The parameter no_file_update
determines whether files are updated (default True). To update test files,
create a script Zuite_setSkipSave in custom folder which returns False
Help:
http://www.seleniumhq.org/docs/02_selenium_ide.jsp#selenium-commands-selenese
http://seleniummaster.com/sitecontent/index.php/introduction-to-selenium-automation/selenium-ide/114-selenium-ide-complete-list-of-commands
Note:
# make sure to set editor to plain text in (erp5 test preferences)
# uses pause when updating files to wait for Cloudooo pdf rendering
# requires text-area editor
# test waitForTitle does not work in FF
-->
<table cellpadding="1" cellspacing="1" border="1">
<thead>
<tr><td rowspan="1" colspan="3">Test RenderJS UI</td></tr>
</thead><tbody>
<tal:block metal:use-macro="here/Zuite_CommonTemplate/macros/init" />
<tr><td rowspan="1" colspan="3">Test Letter(Event) Template UI</td></tr>
</thead>
<tbody>
<tal:block metal:use-macro="here/Zuite_CommonTemplate/macros/init" />
<tal:block tal:define="portal here/portal_url/getPortalObject;
caller python: getattr(context, 'Zuite_setSkipSave', None);
no_file_update python: caller() if caller is not None else True;">
<tr>
<td>open</td>
<td>${base_url}/bar_module/ListBoxZuite_reset</td>
<td></td>
</tr>
<tr>
<td>assertTextPresent</td>
<td>Reset Successfully.</td>
<td></td>
</tr>
<tr>
<td>open</td>
<td>${base_url}/Zuite_setPreferredTextEditor</td>
<td></td>
</tr>
<tr>
<td>assertTextPresent</td>
<td>Editor set to Textarea.</td>
<td></td>
</tr>
<tr>
<td>echo</td>
<td tal:content="python: ''.join(['skipping save: ', str(no_file_update)])"></td>
<td></td>
</tr>
<tal:block tal:condition="python: no_file_update == True">
<tr>
<td>open</td>
<td>${base_url}/Zuite_setConversionServerUrl</td>
<td></td>
</tr>
<tr>
<td>assertTextPresent</td>
<td>Conversion Server Url set.</td>
<td></td>
</tr>
</tal:block>
<tr>
<td>echo</td>
<td>ACTION => EXPORT</td>
<td></td>
</tr>
<!-- CASE 1: event letter, sender/recipient are organisations -->
<tr>
<td>echo</td>
<td>CASE 1: event letter, sender/recipient are organisations</td>
<td></td>
</tr>
<tr>
<td>open</td>
<td>${base_url}/support_request_module/</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>records</td>
<td></td>
</tr>
<tr>
<td>type</td>
<td>name=listbox_title</td>
<td>Template Test Support Request</td>
</tr>
<tr>
<td>keyPressAndWait</td>
<td>listbox_title</td>
<td>\13</td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Template Test Support Request</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[contains(text(), 'Template Test Support Request')]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Requester</td>
<td></td>
</tr>
<!-- Save once to set modification date for live tests -->
<tr>
<td>waitForElementPresent</td>
<td>//button[@class="save"]</td>
<td></td>
</tr>
<tr>
<td>verifyElementPresent</td>
<td>//button[@class="save"]</td>
<td></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>//button[@class="save"]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[@class="transition_message"]</td>
<td></td>
</tr>
<tr>
<td>assertTextPresent</td>
<td>Data updated.</td>
<td></td>
</tr>
<!-- Create a new Event -->
<tr>
<td>selectAndWait</td>
<td>name=select_action</td>
<td>Create New Event</td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Event Type</td>
<td></td>
</tr>
<tr>
<td>select</td>
<td>name=field_your_portal_type
<td>Letter</td>
</tr>
<tr>
<td>verifyTextPresent</td>
<td>Letter</td>
<td></td>
</tr>
<tr>
<td>type</td>
<td>name=field_your_title</td>
<td>Test</td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[@class="bottom"]/div/textarea</td>
<td></td>
</tr>
<tr>
<td>type</td>
<td>//div[@class="bottom"]/div/textarea</td>
<td>Hello</td>
</tr>
<tr>
<td>type</td>
<td>name=subfield_field_your_start_date_year</td>
<td>1999</td>
</tr>
<tr>
<td>type</td>
<td>name=subfield_field_your_start_date_month</td>
<td>12</td>
<tr>
<tr>
<td>type</td>
<td>name=subfield_field_your_start_date_day</td>
<td>31</td>
</tr>
<tr>
<td>select</td>
<td>name=field_your_source</td>
<td>index=2</td>
</tr>
<tr>
<td>select</td>
<td>name=field_your_destination</td>
<td>index=2</td>
</tr>
<tr>
<td>clickAndWait</td>
<td>name=Base_callDialogMethod:method</td>
<td></td>
</tr>
<tr>
<td>waitForElementNotPresent</td>
<td>name=Base_callDialogMethod:method</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Created and associated a new Letter to the ticket.</td>
<td></td>
</tr>
<tr>
<td>verifyValue</td>
<td>name=field_my_aggregate_document_title_list</td>
<td>Test</td>
</tr>
<tr>
<td>open</td>
<td>${base_url}/bar_module/ListBoxZuite_reset</td>
<td></td>
</tr>
<tr>
<td>assertTextPresent</td>
<td>Reset Successfully.</td>
<td></td>
</tr>
<!-- generate letter from support request with sender/recipient organisation -->
<tr>
<td>echo</td>
<td>event letter, sender/recipient are organisations</td>
<td></td>
</tr>
<tr>
<td>open</td>
<td>${base_url}/support_request_module/</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>records</td>
<td></td>
</tr>
<tr>
<td>type</td>
<td>name=listbox_title</td>
<td>Template Test Support Request</td>
</tr>
<tr>
<td>keyPressAndWait</td>
<td>listbox_title</td>
<td>\13</td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Template Test Support Request</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[contains(text(), 'Template Test Support Request')]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Requester</td>
<td></td>
</tr>
<!-- Save once to set modification date for live tests -->
<tr>
<td>waitForElementPresent</td>
<td>//button[@class="save"]</td>
<td></td>
</tr>
<tr>
<td>verifyElementPresent</td>
<td>//button[@class="save"]</td>
<td></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>//button[@class="save"]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[@class="transition_message"]</td>
<td></td>
</tr>
<tr>
<td>assertTextPresent</td>
<td>Data updated.</td>
<td></td>
</tr>
<!-- Create a new Event -->
<tr>
<td>selectAndWait</td>
<td>name=select_action</td>
<td>index=6</td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Event Type</td>
<td></td>
</tr>
<tr>
<td>select</td>
<td>name=field_your_portal_type
<td>index=5</td>
</tr>
<tr>
<td>verifyTextPresent</td>
<td>Letter</td>
<td></td>
</tr>
<tr>
<td>type</td>
<td>name=field_your_title</td>
<td>Test</td>
</tr>
<tr>
<td>type</td>
<td>name=field_your_text_content</td>
<td>Hello</td>
</tr>
<tr>
<td>type</td>
<td>name=subfield_field_your_start_date_year</td>
<td>1999</td>
</tr>
<tr>
<td>type</td>
<td>name=subfield_field_your_start_date_month</td>
<td>12</td>
<tr>
<tr>
<td>type</td>
<td>name=subfield_field_your_start_date_day</td>
<td>31</td>
</tr>
<tr>
<td>select</td>
<td>name=field_your_source</td>
<td>index=2</td>
</tr>
<tr>
<td>select</td>
<td>name=field_your_destination</td>
<td>index=2</td>
</tr>
<tr>
<td>clickAndWait</td>
<td>name=Base_callDialogMethod:method</td>
<td></td>
</tr>
<tr>
<td>waitForElementNotPresent</td>
<td>name=Base_callDialogMethod:method</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Created and associated a new Letter to the ticket.</td>
<td></td>
</tr>
<tr>
<td>verifyValue</td>
<td>name=field_my_aggregate_title_list</td>
<td>Test</td>
</tr>
<!-- test whether preview loads correctly -->
<tr>
<td>clickAndWait</td>
<td>//a/span[contains(text(), 'Preview')]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[contains(text(), '1999-12-31')]</td>
<td></td>
</tr>
<tr>
<td>verifyElementPresent</td>
<td>//div[contains(text(), '1999-12-31')]</td>
<td></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>//a[contains(text(), 'Test')]</td>
<td></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>//a/span[contains(text(), 'View')]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//a[contains(@href, 'my_aggregate_title_list')]</td>
<td></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>//a[contains(@href, 'my_aggregate_title_list')]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Short Title</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//a/span[contains(text(), 'Reader')]</td>
<td></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>//a/span[contains(text(), 'Reader')]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[contains(text(), '1999-12-31')]</td>
<td></td>
</tr>
<tr>
<td>verifyElementPresent</td>
<td>//div[contains(text(), '1999-12-31')]</td>
<td></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>//a[contains(text(), 'Test')]</td>
<td></td>
</tr>
<!-- update 5th pdf document - template_test_letter_input_005_en_pdf -->
<!-- Store this location for re-requesting -->
<tr>
<td>storeLocation</td>
<td>url</td>
<td></td>
</tr>
<tr>
<td>echo</td>
<td>${url}</td>
<td></td>
</tr>
<!-- Can't access pdf source inside iframe, so request page again -->
<tr>
<td>storeEval</td>
<td>function ajax(url) { var xhr = new XMLHttpRequest(); return new Promise(function(resolve, reject) { var k; xhr.open("GET", url, true); xhr.responseType = "blob"; xhr.addEventListener("load", function(e) { if (e.target.status >= 400) { return reject(e); } resolve(e); }); xhr.addEventListener("error", reject); xhr.send(); }, function() { xhr.abort(); }); }; ajax(storedVars["url"].replace("view?ignore_layout:int=1", "WebPage_viewAsWeb") + "?batch_mode=True");</td>
<td>pdf_source</td>
</tr>
<!-- pause to let the ajax request finish. now if the table was a async, queue
that would be nice, 3000 not enough -->
<tr>
<td>pause</td>
<td>6000</td>
<td></td>
</tr>
<tr>
<td>goBackAndWait</td>
<td></td>
<td></td>
</tr>
<tr>
<td>waitForPageToLoad</td>
<td></td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Documents</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[contains(text(), 'Documents')]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>records</td>
<td></td>
</tr>
<tr>
<td>type</td>
<td>name=listbox_reference</td>
<td>Template.Test.Letter</td>
</tr>
<tr>
<td>type</td>
<td>name=listbox_version</td>
<td>005</td>
</tr>
<tr>
<td>keyPressAndWait</td>
<td>listbox_version</td>
<td>\13</td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Template Test Letter</td>
<td></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>//a[contains(text(), 'Template.Test.Letter')]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Short Title</td>
<td></td>
</tr>
<!-- manual form submit -->
<tr>
<td>storeLocation</td>
<td>url</td>
<td></td>
</tr>
<!-- only handle pdf_source (a promise!) here, because it needs to be set on
the iframe and a page-reload resets all (bad) parameters manually set -->
<tr>
<td>storeEval</td>
<td>storedVars["pdf_source"].then(function (evt) {document.getElementById("selenium_myiframe").contentDocument.body.bad_pdf_parameter = new Blob([evt.target.response || evt.target.responseText], {"type": evt.target.getResponseHeader("Content-Type")});});</td>
<td></td>
</tr>
<tr>
<td>storeEval</td>
<td>document.getElementById("selenium_myiframe").contentDocument.body.bad_pdf_parameter</td>
<td>pdf_dump</td>
</tr>
<tr>
<td>echo</td>
<td>${pdf_dump}</td>
<td></td>
</tr>
<tr>
<td>verifyNotExpression</td>
<td>${pdf_dump}</td>
<td>null</td>
</tr>
<tr>
<td>storeEval</td>
<td>function ajax(url, param) { var xhr = new XMLHttpRequest(); return new Promise(function(resolve, reject) { var k; xhr.open("POST", url, true); xhr.responseType = param.dataType || ""; if (typeof param.headers === 'object' &amp;&amp; param.headers !== null) { for (k in param.headers) { if (param.headers.hasOwnProperty(k)) { xhr.setRequestHeader(k, param.headers[k]); } } } xhr.addEventListener("load", function(e) { if (e.target.status >= 400) { return reject(e); } resolve(e); }); xhr.addEventListener("error", reject); if (typeof param.xhrFields === 'object' &amp;&amp; param.xhrFields !== null) { for (k in param.xhrFields) { if (param.xhrFields.hasOwnProperty(k)) { xhr[k] = param.xhrFields[k]; } } } xhr.send(param.data); }, function() { xhr.abort(); }); } var form_data = new FormData(); form_data.append("field_my_file", storedVars["pdf_dump"], "Template.Test.Letter-001-en.pdf"); form_data.append("form_id", "File_view"); x = ajax(storedVars["url"].split("?")[0] + "/Base_edit", {"xhrFields": {"with_credentials": true}, "data": form_data});</td>
<td>promise</td>
</tr>
<tr>
<td>storeEval</td>
<td>storedVars["promise"].then(function () {document.getElementById("selenium_myiframe").src=storedVars["url"].split("?")[0]+"/File_view?portal_status_message=Data%20updated."});</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[@class="transition_message"]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Data updated.</td>
<td></td>
</tr>
<!-- generate image - template_test_slideshow_input_slide_0_005_en_bmp -->
<tr>
<td>echo</td>
<td>update => template_test_slideshow_input_slide_0_005_en_bmp</td>
<td></td>
</tr>
<tr>
<td>storeEval</td>
<td>storedVars["url"].split("?")[0]</td>
<td>screenshot_url</td>
</tr>
<tr>
<td>echo</td>
<td>${screenshot_url}</td>
<td></td>
</tr>
<tr>
<td>open</td>
<td>${screenshot_url}/Document_createScreenshot?frame=0&amp;doc_id=template_test_letter_input_page_0_005_en_bmp</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Screenshot updated.</td>
<td></td>
</tr>
<!-- generate letter from support request with sender/recipient person -->
<tr>
<td>echo</td>
<td>event letter, sender/recipient are persons without career subordinate</td>
<td></td>
</tr>
<tr>
<td>open</td>
<td>${base_url}/support_request_module/</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>records</td>
<td></td>
</tr>
<tr>
<td>type</td>
<td>name=listbox_title</td>
<td>Template Test Support Request</td>
</tr>
<tr>
<td>keyPressAndWait</td>
<td>listbox_title</td>
<td>\13</td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Template Test Support Request</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[contains(text(), 'Template Test Support Request')]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Requester</td>
<td></td>
</tr>
<!-- Save once to set modification date for live tests -->
<tr>
<td>waitForElementPresent</td>
<td>//button[@class="save"]</td>
<td></td>
</tr>
<tr>
<td>verifyElementPresent</td>
<td>//button[@class="save"]</td>
<td></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>//button[@class="save"]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[@class="transition_message"]</td>
<td></td>
</tr>
<tr>
<td>assertTextPresent</td>
<td>Data updated.</td>
<td></td>
</tr>
<!-- Create a new Event -->
<tr>
<td>selectAndWait</td>
<td>name=select_action</td>
<td>index=6</td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Event Type</td>
<td></td>
</tr>
<tr>
<td>select</td>
<td>name=field_your_portal_type
<td>index=5</td>
</tr>
<tr>
<td>verifyTextPresent</td>
<td>Letter</td>
<td></td>
</tr>
<tr>
<td>type</td>
<td>name=field_your_title</td>
<td>Test</td>
</tr>
<tr>
<td>type</td>
<td>name=field_your_text_content</td>
<td>Hello</td>
</tr>
<tr>
<td>type</td>
<td>name=subfield_field_your_start_date_year</td>
<td>1999</td>
</tr>
<tr>
<td>type</td>
<td>name=subfield_field_your_start_date_month</td>
<td>12</td>
<tr>
<tr>
<td>type</td>
<td>name=subfield_field_your_start_date_day</td>
<td>31</td>
</tr>
<tr>
<td>select</td>
<td>name=field_your_source</td>
<td>index=4</td>
</tr>
<tr>
<td>select</td>
<td>name=field_your_destination</td>
<td>index=4</td>
</tr>
<tr>
<td>clickAndWait</td>
<td>name=Base_callDialogMethod:method</td>
<td></td>
</tr>
<tr>
<td>waitForElementNotPresent</td>
<td>name=Base_callDialogMethod:method</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Created and associated a new Letter to the ticket.</td>
<td></td>
</tr>
<!-- test whether preview loads correctly -->
<tr>
<td>clickAndWait</td>
<td>//a/span[contains(text(), 'Preview')]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[contains(text(), '1999-12-31')]</td>
<td></td>
</tr>
<tr>
<td>verifyElementPresent</td>
<td>//div[contains(text(), '1999-12-31')]</td>
<td></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>//a[contains(text(), 'Test')]</td>
<td></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>//a/span[contains(text(), 'View')]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//a[contains(@href, 'my_aggregate_title_list')]</td>
<td></td>
</tr>
<tr>
<td>verifyValue</td>
<td>name=field_my_aggregate_title_list</td>
<td>Test</td>
</tr>
<tr>
<td>clickAndWait</td>
<td>//a[contains(@href, 'my_aggregate_title_list')]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Short Title</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//a/span[contains(text(), 'Reader')]</td>
<td></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>//a/span[contains(text(), 'Reader')]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[contains(text(), '1999-12-31')]</td>
<td></td>
</tr>
<tr>
<td>verifyElementPresent</td>
<td>//div[contains(text(), '1999-12-31')]</td>
<td></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>//a[contains(text(), 'Test')]</td>
<td></td>
</tr>
<!-- update 6th pdf document - template_test_letter_input_006_en_pdf -->
<!-- Store this location for re-requesting -->
<tr>
<td>storeLocation</td>
<td>url</td>
<td></td>
</tr>
<tr>
<td>echo</td>
<td>${url}</td>
<td></td>
</tr>
<!-- Can't access pdf source inside iframe, so request page again -->
<tr>
<td>storeEval</td>
<td>function ajax(url) { var xhr = new XMLHttpRequest(); return new Promise(function(resolve, reject) { var k; xhr.open("GET", url, true); xhr.responseType = "blob"; xhr.addEventListener("load", function(e) { if (e.target.status >= 400) { return reject(e); } resolve(e); }); xhr.addEventListener("error", reject); xhr.send(); }, function() { xhr.abort(); }); }; ajax(storedVars["url"].replace("view?ignore_layout:int=1", "WebPage_viewAsWeb") + "?batch_mode=True");</td>
<td>pdf_source</td>
</tr>
<!-- pause to let the ajax request finish. now if the table was a async, queue
that would be nice, 3000 not enough -->
<tr>
<td>pause</td>
<td>6000</td>
<td></td>
</tr>
<!-- test whether preview loads correctly both by accessing
preview on the event and the document itself. DOESN'T WORK IN FF51-->
<tal:block tal:condition="python: no_file_update == False">
<tr>
<td>clickAndWait</td>
<td>//a/span[contains(text(), 'Preview')]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[contains(text(), '1999-12-31')]</td>
<td></td>
</tr>
<tr>
<td>verifyElementPresent</td>
<td>//div[contains(text(), '1999-12-31')]</td>
<td></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>//a[contains(text(), 'Test')]</td>
<td></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>//a/span[contains(text(), 'View')]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//a[contains(@href, 'my_aggregate_document_title_list')]</td>
<td></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>//a[contains(@href, 'my_aggregate_document_title_list')]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Short Title</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//a/span[contains(text(), 'Preview')]</td>
<td></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>//a/span[contains(text(), 'Preview')]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[contains(text(), '1999-12-31')]</td>
<td></td>
</tr>
<tr>
<td>verifyElementPresent</td>
<td>//div[contains(text(), '1999-12-31')]</td>
<td></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>//a[contains(text(), 'Test')]</td>
<td></td>
</tr>
</tal:block>
<tr>
<td>goBackAndWait</td>
<td></td>
<td></td>
</tr>
<tr>
<td>waitForPageToLoad</td>
<td></td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Documents</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[contains(text(), 'Documents')]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>records</td>
<td></td>
</tr>
<tr>
<td>type</td>
<td>name=listbox_reference</td>
<td>Template.Test.Letter</td>
</tr>
<tr>
<td>type</td>
<td>name=listbox_version</td>
<td>006</td>
</tr>
<tr>
<td>keyPressAndWait</td>
<td>listbox_version</td>
<td>\13</td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Template Test Letter</td>
<td></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>//a[contains(text(), 'Template.Test.Letter')]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Short Title</td>
<td></td>
</tr>
<!-- manual form submit -->
<tr>
<td>storeLocation</td>
<td>url</td>
<td></td>
</tr>
<!-- only handle pdf_source (a promise!) here, because it needs to be set on
the iframe and a page-reload resets all (bad) parameters manually set -->
<tr>
<td>storeEval</td>
<td>storedVars["pdf_source"].then(function (evt) {document.getElementById("selenium_myiframe").contentDocument.body.bad_pdf_parameter = new Blob([evt.target.response || evt.target.responseText], {"type": evt.target.getResponseHeader("Content-Type")});});</td>
<td></td>
</tr>
<tr>
<td>storeEval</td>
<td>document.getElementById("selenium_myiframe").contentDocument.body.bad_pdf_parameter</td>
<td>pdf_dump</td>
</tr>
<tr>
<td>echo</td>
<td>${pdf_dump}</td>
<td></td>
</tr>
<tr>
<td>verifyNotExpression</td>
<td>${pdf_dump}</td>
<td>null</td>
</tr>
<tr>
<td>storeEval</td>
<td>function ajax(url, param) { var xhr = new XMLHttpRequest(); return new Promise(function(resolve, reject) { var k; xhr.open("POST", url, true); xhr.responseType = param.dataType || ""; if (typeof param.headers === 'object' &amp;&amp; param.headers !== null) { for (k in param.headers) { if (param.headers.hasOwnProperty(k)) { xhr.setRequestHeader(k, param.headers[k]); } } } xhr.addEventListener("load", function(e) { if (e.target.status >= 400) { return reject(e); } resolve(e); }); xhr.addEventListener("error", reject); if (typeof param.xhrFields === 'object' &amp;&amp; param.xhrFields !== null) { for (k in param.xhrFields) { if (param.xhrFields.hasOwnProperty(k)) { xhr[k] = param.xhrFields[k]; } } } xhr.send(param.data); }, function() { xhr.abort(); }); } var form_data = new FormData(); form_data.append("field_my_file", storedVars["pdf_dump"], "Template.Test.Letter-001-en.pdf"); form_data.append("form_id", "File_view"); x = ajax(storedVars["url"].split("?")[0] + "/Base_edit", {"xhrFields": {"with_credentials": true}, "data": form_data});</td>
<td>promise</td>
</tr>
<tr>
<td>storeEval</td>
<td>storedVars["promise"].then(function () {document.getElementById("selenium_myiframe").src=storedVars["url"].split("?")[0]+"/File_view?portal_status_message=Data%20updated."});</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[@class="transition_message"]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Data updated.</td>
<td></td>
</tr>
<!-- generate image - template_test_slideshow_input_slide_0_006_en_bmp -->
<tr>
<td>echo</td>
<td>update => template_test_slideshow_input_slide_0_006_en_bmp</td>
<td></td>
</tr>
<tr>
<td>storeEval</td>
<td>storedVars["url"].split("?")[0]</td>
<td>screenshot_url</td>
</tr>
<tr>
<td>echo</td>
<td>${screenshot_url}</td>
<td></td>
</tr>
<tr>
<td>open</td>
<td>${screenshot_url}/Document_createScreenshot?frame=0&amp;doc_id=template_test_letter_input_page_0_006_en_bmp</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Screenshot updated.</td>
<td></td>
</tr>
<!-- update 5th pdf document - template_test_letter_input_005_en_pdf -->
<tal:block tal:condition="python: no_file_update == False">
</tbody></table>
<!-- Store location for re-requesting -->
<tr>
<td>storeLocation</td>
<td>url</td>
<td></td>
</tr>
<tr>
<td>echo</td>
<td>${url}</td>
<td></td>
</tr>
<!-- Can't access pdf source inside iframe, so request page again -->
<tr>
<td>storeEval</td>
<td>function ajax(url) { var xhr = new XMLHttpRequest(); return new Promise(function(resolve, reject) { var k; xhr.open("GET", url, true); xhr.responseType = "blob"; xhr.addEventListener("load", function(e) { if (e.target.status >= 400) { return reject(e); } resolve(e); }); xhr.addEventListener("error", reject); xhr.send(); }, function() { xhr.abort(); }); }; ajax(storedVars["url"].replace("view?ignore_layout:int=1", "WebPage_viewAsWeb") + "?batch_mode=True");</td>
<td>pdf_source</td>
</tr>
<!-- pause to let the ajax request finish. 3000 wait not long enough -->
<tr>
<td>pause</td>
<td>6000</td>
<td></td>
</tr>
<tr>
<td>goBackAndWait</td>
<td></td>
<td></td>
</tr>
<tr>
<td>waitForPageToLoad</td>
<td></td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Documents</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[contains(text(), 'Documents')]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>records</td>
<td></td>
</tr>
<tr>
<td>type</td>
<td>name=listbox_reference</td>
<td>Template.Test.Letter</td>
</tr>
<tr>
<td>type</td>
<td>name=listbox_version</td>
<td>005</td>
</tr>
<tr>
<td>keyPressAndWait</td>
<td>listbox_version</td>
<td>\13</td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Template Test Letter</td>
<td></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>//a[contains(text(), 'Template.Test.Letter')]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Short Title</td>
<td></td>
</tr>
</tal:block>
<!-- manual form submit -->
<tal:block tal:condition="python: no_file_update == False">
<tr>
<td>storeLocation</td>
<td>url</td>
<td></td>
</tr>
<!-- only handle pdf_source (a promise!) here, because it needs to be set on
the iframe and a page-reload resets all (bad) parameters manually set -->
<tr>
<td>storeEval</td>
<td>storedVars["pdf_source"].then(function (evt) {document.getElementById("selenium_myiframe").contentDocument.body.bad_pdf_parameter = new Blob([evt.target.response || evt.target.responseText], {"type": evt.target.getResponseHeader("Content-Type")});});</td>
<td></td>
</tr>
<tr>
<td>storeEval</td>
<td>document.getElementById("selenium_myiframe").contentDocument.body.bad_pdf_parameter</td>
<td>pdf_dump</td>
</tr>
<tr>
<td>echo</td>
<td>${pdf_dump}</td>
<td></td>
</tr>
<tr>
<td>verifyNotExpression</td>
<td>${pdf_dump}</td>
<td>null</td>
</tr>
<tr>
<td>storeEval</td>
<td>function ajax(url, param) { var xhr = new XMLHttpRequest(); return new Promise(function(resolve, reject) { var k; xhr.open("POST", url, true); xhr.responseType = param.dataType || ""; if (typeof param.headers === 'object' &amp;&amp; param.headers !== null) { for (k in param.headers) { if (param.headers.hasOwnProperty(k)) { xhr.setRequestHeader(k, param.headers[k]); } } } xhr.addEventListener("load", function(e) { if (e.target.status >= 400) { return reject(e); } resolve(e); }); xhr.addEventListener("error", reject); if (typeof param.xhrFields === 'object' &amp;&amp; param.xhrFields !== null) { for (k in param.xhrFields) { if (param.xhrFields.hasOwnProperty(k)) { xhr[k] = param.xhrFields[k]; } } } xhr.send(param.data); }, function() { xhr.abort(); }); } var form_data = new FormData(); form_data.append("field_my_file", storedVars["pdf_dump"], "Template.Test.Letter-001-en.pdf"); form_data.append("form_id", "File_view"); x = ajax(storedVars["url"].split("?")[0] + "/Base_edit", {"xhrFields": {"with_credentials": true}, "data": form_data});</td>
<td>promise</td>
</tr>
<tr>
<td>storeEval</td>
<td>storedVars["promise"].then(function () {document.getElementById("selenium_myiframe").src=storedVars["url"].split("?")[0]+"/File_view?portal_status_message=Data%20updated."});</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[@class="transition_message"]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Data updated.</td>
<td></td>
</tr>
<!-- generate image - template_test_slideshow_input_slide_0_005_en_bmp -->
<tr>
<td>echo</td>
<td>update => template_test_slideshow_input_slide_0_005_en_bmp</td>
<td></td>
</tr>
<tr>
<td>storeEval</td>
<td>storedVars["url"].split("?")[0]</td>
<td>screenshot_url</td>
</tr>
<tr>
<td>echo</td>
<td>${screenshot_url}</td>
<td></td>
</tr>
<tr>
<td>open</td>
<td>${screenshot_url}/Document_createScreenshot?frame=0&amp;doc_id=template_test_letter_input_page_0_005_en_bmp</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Screenshot updated.</td>
<td></td>
</tr>
</tal:block>
<!-- CASE 2: generate letter from support request with sender/recipient person -->
<tr>
<td>echo</td>
<td>CASE 2: event letter, sender/recipient are persons without career subordinate</td>
<td></td>
</tr>
<tr>
<td>open</td>
<td>${base_url}/support_request_module/</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>records</td>
<td></td>
</tr>
<tr>
<td>type</td>
<td>name=listbox_title</td>
<td>Template Test Support Request</td>
</tr>
<tr>
<td>keyPressAndWait</td>
<td>listbox_title</td>
<td>\13</td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Template Test Support Request</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[contains(text(), 'Template Test Support Request')]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Requester</td>
<td></td>
</tr>
<!-- Save once to set modification date for live tests -->
<tr>
<td>waitForElementPresent</td>
<td>//button[@class="save"]</td>
<td></td>
</tr>
<tr>
<td>verifyElementPresent</td>
<td>//button[@class="save"]</td>
<td></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>//button[@class="save"]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[@class="transition_message"]</td>
<td></td>
</tr>
<tr>
<td>assertTextPresent</td>
<td>Data updated.</td>
<td></td>
</tr>
<!-- Create a new Event -->
<tr>
<td>selectAndWait</td>
<td>name=select_action</td>
<td>Create New Event</td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Event Type</td>
<td></td>
</tr>
<tr>
<td>select</td>
<td>name=field_your_portal_type
<td>Letter</td>
</tr>
<tr>
<td>verifyTextPresent</td>
<td>Letter</td>
<td></td>
</tr>
<tr>
<td>type</td>
<td>name=field_your_title</td>
<td>Test</td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[@class="bottom"]/div/textarea</td>
<td></td>
</tr>
<tr>
<td>type</td>
<td>//div[@class="bottom"]/div/textarea</td>
<td>Hello</td>
</tr>
<tr>
<td>type</td>
<td>name=subfield_field_your_start_date_year</td>
<td>1999</td>
</tr>
<tr>
<td>type</td>
<td>name=subfield_field_your_start_date_month</td>
<td>12</td>
<tr>
<tr>
<td>type</td>
<td>name=subfield_field_your_start_date_day</td>
<td>31</td>
</tr>
<tr>
<td>select</td>
<td>name=field_your_source</td>
<td>index=4</td>
</tr>
<tr>
<td>select</td>
<td>name=field_your_destination</td>
<td>index=4</td>
</tr>
<tr>
<td>clickAndWait</td>
<td>name=Base_callDialogMethod:method</td>
<td></td>
</tr>
<tr>
<td>waitForElementNotPresent</td>
<td>name=Base_callDialogMethod:method</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Created and associated a new Letter to the ticket.</td>
<td></td>
</tr>
<!-- test whether preview loads correctly both by accessing
preview on the event and the document itself. DOESN'T WORK IN FF51-->
<tal:block tal:condition="python: no_file_update == False">
<tr>
<td>clickAndWait</td>
<td>//a/span[contains(text(), 'Preview')]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[contains(text(), '1999-12-31')]</td>
<td></td>
</tr>
<tr>
<td>verifyElementPresent</td>
<td>//div[contains(text(), '1999-12-31')]</td>
<td></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>//a[contains(text(), 'Test')]</td>
<td></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>//a/span[contains(text(), 'View')]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//a[contains(@href, 'my_aggregate_document_title_list')]</td>
<td></td>
</tr>
<tr>
<td>verifyValue</td>
<td>name=field_my_aggregate_document_title_list</td>
<td>Test</td>
</tr>
<tr>
<td>clickAndWait</td>
<td>//a[contains(@href, 'my_aggregate_document_title_list')]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Short Title</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//a/span[contains(text(), 'Preview')]</td>
<td></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>//a/span[contains(text(), 'Preview')]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[contains(text(), '1999-12-31')]</td>
<td></td>
</tr>
<tr>
<td>verifyElementPresent</td>
<td>//div[contains(text(), '1999-12-31')]</td>
<td></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>//a[contains(text(), 'Test')]</td>
<td></td>
</tr>
</tal:block>
<!-- update 6th pdf document - template_test_letter_input_006_en_pdf -->
<tal:block tal:condition="python: no_file_update == False">
<!-- Store this location for re-requesting -->
<tr>
<td>storeLocation</td>
<td>url</td>
<td></td>
</tr>
<tr>
<td>echo</td>
<td>${url}</td>
<td></td>
</tr>
<!-- Can't access pdf source inside iframe, so request page again -->
<tr>
<td>storeEval</td>
<td>function ajax(url) { var xhr = new XMLHttpRequest(); return new Promise(function(resolve, reject) { var k; xhr.open("GET", url, true); xhr.responseType = "blob"; xhr.addEventListener("load", function(e) { if (e.target.status >= 400) { return reject(e); } resolve(e); }); xhr.addEventListener("error", reject); xhr.send(); }, function() { xhr.abort(); }); }; ajax(storedVars["url"].replace("view?ignore_layout:int=1", "WebPage_viewAsWeb") + "?batch_mode=True");</td>
<td>pdf_source</td>
</tr>
<!-- pause to let the ajax request finish. now if the table was a async, queue
that would be nice, 3000 not enough -->
<tr>
<td>pause</td>
<td>6000</td>
<td></td>
</tr>
<tr>
<td>goBackAndWait</td>
<td></td>
<td></td>
</tr>
<tr>
<td>waitForPageToLoad</td>
<td></td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Documents</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[contains(text(), 'Documents')]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>records</td>
<td></td>
</tr>
<tr>
<td>type</td>
<td>name=listbox_reference</td>
<td>Template.Test.Letter</td>
</tr>
<tr>
<td>type</td>
<td>name=listbox_version</td>
<td>006</td>
</tr>
<tr>
<td>keyPressAndWait</td>
<td>listbox_version</td>
<td>\13</td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Template Test Letter</td>
<td></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>//a[contains(text(), 'Template.Test.Letter')]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Short Title</td>
<td></td>
</tr>
</tal:block>
<!-- manual form submit -->
<tal:block tal:condition="python: no_file_update == False">
<tr>
<td>storeLocation</td>
<td>url</td>
<td></td>
</tr>
<!-- only handle pdf_source (a promise!) here, because it needs to be set on
the iframe and a page-reload resets all (bad) parameters manually set -->
<tr>
<td>storeEval</td>
<td>storedVars["pdf_source"].then(function (evt) {document.getElementById("selenium_myiframe").contentDocument.body.bad_pdf_parameter = new Blob([evt.target.response || evt.target.responseText], {"type": evt.target.getResponseHeader("Content-Type")});});</td>
<td></td>
</tr>
<tr>
<td>storeEval</td>
<td>document.getElementById("selenium_myiframe").contentDocument.body.bad_pdf_parameter</td>
<td>pdf_dump</td>
</tr>
<tr>
<td>echo</td>
<td>${pdf_dump}</td>
<td></td>
</tr>
<tr>
<td>verifyNotExpression</td>
<td>${pdf_dump}</td>
<td>null</td>
</tr>
<tr>
<td>storeEval</td>
<td>function ajax(url, param) { var xhr = new XMLHttpRequest(); return new Promise(function(resolve, reject) { var k; xhr.open("POST", url, true); xhr.responseType = param.dataType || ""; if (typeof param.headers === 'object' &amp;&amp; param.headers !== null) { for (k in param.headers) { if (param.headers.hasOwnProperty(k)) { xhr.setRequestHeader(k, param.headers[k]); } } } xhr.addEventListener("load", function(e) { if (e.target.status >= 400) { return reject(e); } resolve(e); }); xhr.addEventListener("error", reject); if (typeof param.xhrFields === 'object' &amp;&amp; param.xhrFields !== null) { for (k in param.xhrFields) { if (param.xhrFields.hasOwnProperty(k)) { xhr[k] = param.xhrFields[k]; } } } xhr.send(param.data); }, function() { xhr.abort(); }); } var form_data = new FormData(); form_data.append("field_my_file", storedVars["pdf_dump"], "Template.Test.Letter-001-en.pdf"); form_data.append("form_id", "File_view"); x = ajax(storedVars["url"].split("?")[0] + "/Base_edit", {"xhrFields": {"with_credentials": true}, "data": form_data});</td>
<td>promise</td>
</tr>
<tr>
<td>storeEval</td>
<td>storedVars["promise"].then(function () {document.getElementById("selenium_myiframe").src=storedVars["url"].split("?")[0]+"/File_view?portal_status_message=Data%20updated."});</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[@class="transition_message"]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Data updated.</td>
<td></td>
</tr>
<!-- generate image - template_test_slideshow_input_slide_0_006_en_bmp -->
<tr>
<td>echo</td>
<td>update => template_test_slideshow_input_slide_0_006_en_bmp</td>
<td></td>
</tr>
<tr>
<td>storeEval</td>
<td>storedVars["url"].split("?")[0]</td>
<td>screenshot_url</td>
</tr>
<tr>
<td>echo</td>
<td>${screenshot_url}</td>
<td></td>
</tr>
<tr>
<td>open</td>
<td>${screenshot_url}/Document_createScreenshot?frame=0&amp;doc_id=template_test_letter_input_page_0_006_en_bmp</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Screenshot updated.</td>
<td></td>
</tr>
</tal:block>
</tal:block>
</tbody>
</table>
</body>
</html>
\ No newline at end of file
......@@ -6,1193 +6,1243 @@
</head>
<body>
<!--
UPDATE comparison files for LIVE TESTS | DON'T RUN AUTOMATICALLY
(else tests will always pass...)
TEST UI and/or UPDATE FILES for live tests
This Zuite updates all test files (diff-html, pdfs, bmps) used in the LiveTests
based on the example web pages included in this bt5. Run this zuite after making
changes to the bt5 which will alter their look to automatically update all files
(else you need to do it by hand). This also means: DON'T RUN THIS AUTOMATICALLY,
because it will also update all test files with any errors you make, causing
liveTests to always pass (comparing wrong rendering to wrong test file).
This Zuite updates all test files (diff-html, pdfs, bmp) used in the LiveTests
based on the example web pages included in this bt5. The parameter no_file_update
determines whether files are updated (default True). To update test files,
create a script Zuite_setSkipSave in custom folder which returns False
Help:
http://www.seleniumhq.org/docs/02_selenium_ide.jsp#selenium-commands-selenese
http://seleniummaster.com/sitecontent/index.php/introduction-to-selenium-automation/selenium-ide/114-selenium-ide-complete-list-of-commands
Note:
# make sure to set editor to plain text in (erp5 test preferences)
# uses pause when updating files to wait for Cloudooo pdf rendering
# requires text-area editor
# test waitForTitle does not work in FF
-->
<table cellpadding="1" cellspacing="1" border="1">
<thead>
<tr><td rowspan="1" colspan="3">Test RenderJS UI</td></tr>
</thead><tbody>
<tal:block metal:use-macro="here/Zuite_CommonTemplate/macros/init" />
<tr>
<td>open</td>
<td>${base_url}/bar_module/ListBoxZuite_reset</td>
<td></td>
</tr>
<tr>
<td>assertTextPresent</td>
<td>Reset Successfully.</td>
<td></td>
</tr>
<!-- update 1st output - template_test_release_output_expected_001_en_html -->
<tr>
<td>echo</td>
<td>action => export</td>
<td></td>
</tr>
<tr>
<td>echo</td>
<td>update => template_test_release_output_expected_001_en_html</td>
<td></td>
</tr>
<tr>
<td>open</td>
<td>${base_url}/web_page_module/</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>records</td>
<td></td>
</tr>
<tr>
<td>type</td>
<td>name=listbox_reference</td>
<td>Template.Test.Release</td>
</tr>
<tr>
<td>type</td>
<td>name=listbox_version</td>
<td>001</td>
</tr>
<tr>
<td>keyPressAndWait</td>
<td>listbox_version</td>
<td>\13</td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Template Test Release</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[contains(text(), 'Template.Test.Release')]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Short Title</td>
<td></td>
</tr>
<!-- Save once to set modification date for live tests -->
<tr>
<td>waitForElementPresent</td>
<td>//button[@class="save"]</td>
<td></td>
</tr>
<tr>
<td>verifyElementPresent</td>
<td>//button[@class="save"]</td>
<td></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>//button[@class="save"]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[@class="transition_message"]</td>
<td></td>
</tr>
<tr>
<td>assertTextPresent</td>
<td>Data updated.</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//button[@class="import_export"]</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//button[@class="import_export"]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Export Slideshow</td>
<td></td>
</tr>
<tr>
<td>selectAndWait</td>
<td>name=select_dialog</td>
<td>index=4</td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Export Release</td>
<td></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>name=Base_showUpdateDialog:method</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[@class="transition_message"]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Preview updated.</td>
<td></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>name=Base_callDialogMethod:method</td>
<td></td>
</tr>
<tr>
<td>waitForElementNotPresent</td>
<td>name=Base_callDialogMethod:method</td>
<td></td>
</tr>
<tr>
<td>waitForPageToLoad</td>
<td></td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>©</td>
<td></td>
</tr>
<tr>
<td>storeLocation</td>
<td>url</td>
<td></td>
</tr>
<tr>
<td>echo</td>
<td>${url}</td>
<td></td>
</tr>
<!-- Can't fetch iframe source, so request page again -->
<tr>
<td>storeEval</td>
<td>function ajax(url) {var xhr = new XMLHttpRequest();return new Promise(function(resolve, reject) {var k;xhr.open("GET", url, true);xhr.addEventListener("load", function(e) {if (e.target.status >= 400) {return reject(e);}resolve(e);});xhr.addEventListener("error", reject);xhr.send();}, function() {xhr.abort();});};ajax(storedVars["url"] + "&amp;batch_mode=True");</td>
<td>page_source</td>
</tr>
<tr>
<td>goBackAndWait</td>
<td></td>
<td></td>
</tr>
<tr>
<td>waitForPageToLoad</td>
<td></td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Web Pages</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[contains(text(), 'Web Pages')]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>records</td>
<td></td>
</tr>
<tr>
<td>type</td>
<td>name=listbox_reference</td>
<td>%Template% AND %Output% AND %Release%</td>
</tr>
<tr>
<td>type</td>
<td>name=listbox_version</td>
<td>001</td>
</tr>
<tr>
<td>keyPressAndWait</td>
<td>listbox_reference</td>
<td>\13</td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Template.Test.Release.Expected.Output.Sample</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[contains(text(), 'Template.Test.Release.Expected.Output.Sample')]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Short Title</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//a/span[contains(text(), 'Edit')]</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a/span[contains(text(), 'Edit')]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//textarea[@name="field_my_text_content"]</td>
<td></td>
</tr>
<tr>
<td>storeEval</td>
<td>storedVars["page_source"].then(function (evt) {var content = evt.target.response || evt.target.responseText;document.getElementById("selenium_myiframe").contentDocument.body.bad_parameter = content;})</td>
<td></td>
</tr>
<tr>
<td>storeEval</td>
<td>document.getElementById("selenium_myiframe").contentDocument.body.bad_parameter;</td>
<td>dump</td>
</tr>
<tr>
<td>type</td>
<td>//textarea[@name="field_my_text_content"]</td>
<td>${dump}</td>
</tr>
<tr>
<td>verifyElementPresent</td>
<td>//button[@class="save"]</td>
<td></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>//button[@class="save"]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[@class="transition_message"]</td>
<td></td>
</tr>
<tr>
<td>assertTextPresent</td>
<td>Data updated.</td>
<td></td>
</tr>
<!-- update 2nd output - template_test_release_output_expected_002_de_html -->
<tr>
<td>echo</td>
<td>update => template_test_release_output_expected_002_de_html</td>
<td></td>
</tr>
<tr>
<td>verifyTextPresent</td>
<td>Web Pages</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[contains(text(), 'Web Pages')]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>records</td>
<td></td>
</tr>
<tr>
<td>type</td>
<td>name=listbox_reference</td>
<td>Template.Test.Release</td>
</tr>
<tr>
<td>type</td>
<td>name=listbox_version</td>
<td>002</td>
</tr>
<tr>
<td>keyPressAndWait</td>
<td>listbox_version</td>
<td>\13</td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Template Test Release</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[contains(text(), 'Template.Test.Release')]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Short Title</td>
<td></td>
</tr>
<!-- Save once to set modification date for live tests -->
<tr>
<td>waitForElementPresent</td>
<td>//button[@class="save"]</td>
<td></td>
</tr>
<tr>
<td>verifyElementPresent</td>
<td>//button[@class="save"]</td>
<td></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>//button[@class="save"]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[@class="transition_message"]</td>
<td></td>
</tr>
<tr>
<td>assertTextPresent</td>
<td>Data updated.</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//button[@class="import_export"]</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//button[@class="import_export"]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Export Slideshow</td>
<td></td>
</tr>
<tr>
<td>selectAndWait</td>
<td>name=select_dialog</td>
<td>index=4</td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Export Release</td>
<td></td>
</tr>
<tr>
<td>type</td>
<td>name=field_override_source_organisation_title</td>
<td>Test Association</td>
</tr>
<tr>
<td>type</td>
<td>name=field_override_source_person_title</td>
<td>Test Association Member</td>
</tr>
<tr>
<td>uncheck</td>
<td>name=field_display_about</td>
<td></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>name=Base_showUpdateDialog:method</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[@class="transition_message"]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Preview updated.</td>
<td></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>name=Base_callDialogMethod:method</td>
<td></td>
</tr>
<tr>
<td>waitForPageToLoad</td>
<td></td>
<td></td>
</tr>
<tr>
<td>waitForElementNotPresent</td>
<td>name=Base_callDialogMethod:method</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>©</td>
<td></td>
</tr>
<tr>
<td>storeLocation</td>
<td>url</td>
<td></td>
</tr>
<tr>
<td>echo</td>
<td>${url}</td>
<td></td>
</tr>
<!-- Can't fetch iframe source, so request page again -->
<tr>
<td>storeEval</td>
<td>function ajax(url) {var xhr = new XMLHttpRequest();return new Promise(function(resolve, reject) {var k;xhr.open("GET", url, true);xhr.addEventListener("load", function(e) {if (e.target.status >= 400) {return reject(e);}resolve(e);});xhr.addEventListener("error", reject);xhr.send();}, function() {xhr.abort();});};ajax(storedVars["url"] + "&amp;batch_mode=True");</td>
<td>page_source</td>
</tr>
<tr>
<td>goBackAndWait</td>
<td></td>
<td></td>
</tr>
<tr>
<td>waitForPageToLoad</td>
<td></td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Web Pages</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[contains(text(), 'Web Pages')]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>records</td>
<td></td>
</tr>
<tr>
<td>type</td>
<td>name=listbox_reference</td>
<td>%Template% AND %Output% AND %Release%</td>
</tr>
<tr>
<td>type</td>
<td>name=listbox_version</td>
<td>002</td>
</tr>
<tr>
<td>keyPressAndWait</td>
<td>listbox_reference</td>
<td>\13</td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Template.Test.Release.Expected.Output.Sample</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[contains(text(), 'Template.Test.Release.Expected.Output.Sample')]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Short Title</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//a/span[contains(text(), 'Edit')]</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a/span[contains(text(), 'Edit')]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//textarea[@name="field_my_text_content"]</td>
<td></td>
</tr>
<tr>
<td>storeEval</td>
<td>storedVars["page_source"].then(function (evt) {var content = evt.target.response || evt.target.responseText;document.getElementById("selenium_myiframe").contentDocument.body.bad_parameter = content;})</td>
<td></td>
</tr>
<tr>
<td>storeEval</td>
<td>document.getElementById("selenium_myiframe").contentDocument.body.bad_parameter;</td>
<td>dump</td>
</tr>
<tr>
<td>type</td>
<td>//textarea[@name="field_my_text_content"]</td>
<td>${dump}</td>
</tr>
<tr>
<td>verifyElementPresent</td>
<td>//button[@class="save"]</td>
<td></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>//button[@class="save"]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[@class="transition_message"]</td>
<td></td>
</tr>
<tr>
<td>assertTextPresent</td>
<td>Data updated.</td>
<td></td>
</tr>
<!-- update 1st pdf document - template_test_release_input_001_en_pdf -->
<tr>
<td>echo</td>
<td>update => template_test_release_input_001_en_pdf</td>
<td></td>
</tr>
<tr>
<td>open</td>
<td>${base_url}/web_page_module/</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>records</td>
<td></td>
</tr>
<tr>
<td>type</td>
<td>name=listbox_reference</td>
<td>Template.Test.Release</td>
</tr>
<tr>
<td>type</td>
<td>name=listbox_version</td>
<td>001</td>
</tr>
<tr>
<td>keyPressAndWait</td>
<td>listbox_version</td>
<td>\13</td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Template Test Release</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[contains(text(), 'Template.Test.Release')]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Short Title</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//button[@class="import_export"]</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//button[@class="import_export"]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Export Slideshow</td>
<td></td>
</tr>
<tr>
<td>selectAndWait</td>
<td>name=select_dialog</td>
<td>index=4</td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Export Release</td>
<td></td>
</tr>
<tr>
<td>select</td>
<td>name=field_format</td>
<td>index=1</td>
</tr>
<tr>
<td>clickAndWait</td>
<td>name=Base_callDialogMethod:method</td>
<td></td>
</tr>
<tr>
<td>waitForPageToLoad</td>
<td></td>
<td></td>
</tr>
<!-- PDF viewer has no document.title, wait for "" means pdf is loaded -->
<tr>
<td>waitForTitle</td>
<td></td>
<td></td>
</tr>
<tr>
<td>verifyTitle</td>
<td></td>
<td></td>
</tr>
<!-- Store this location for re-requesting -->
<tr>
<td>storeLocation</td>
<td>url</td>
<td></td>
</tr>
<tr>
<td>echo</td>
<td>${url}</td>
<td></td>
</tr>
<!-- Can't access pdf source inside iframe, so request page again -->
<tr>
<td>storeEval</td>
<td>function ajax(url) { var xhr = new XMLHttpRequest(); return new Promise(function(resolve, reject) { var k; xhr.open("GET", url, true); xhr.responseType = "blob"; xhr.addEventListener("load", function(e) { if (e.target.status >= 400) { return reject(e); } resolve(e); }); xhr.addEventListener("error", reject); xhr.send(); }, function() { xhr.abort(); }); }; ajax(storedVars["url"] + "&amp;batch_mode=True");</td>
<td>pdf_source</td>
</tr>
<!-- pause to let the ajax request finish. now if the table was a async, queue
that would be nice, 3/6/9000 not enough-->
<tr>
<td>pause</td>
<td>12000</td>
<td></td>
</tr>
<tr>
<td>goBackAndWait</td>
<td></td>
<td></td>
</tr>
<tr>
<td>waitForPageToLoad</td>
<td></td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Web Pages</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[contains(text(), 'ERP5')]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//a[contains(text(), 'Documents')]</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[contains(text(), 'Documents')]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>records</td>
<td></td>
</tr>
<tr>
<td>type</td>
<td>name=listbox_reference</td>
<td>Template.Test.Release</td>
</tr>
<tr>
<td>type</td>
<td>name=listbox_version</td>
<td>001</td>
</tr>
<tr>
<td>keyPressAndWait</td>
<td>listbox_version</td>
<td>\13</td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Template Test Release</td>
<td></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>//a[contains(text(), 'Template.Test.Release')]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Short Title</td>
<td></td>
</tr>
<!-- manual form submit -->
<tr>
<td>storeLocation</td>
<td>url</td>
<td></td>
</tr>
<!-- only handle pdf_source (a promise!) here, because it needs to be set on
the iframe and a page-reload resets all (bad) parameters manually set -->
<tr>
<td>storeEval</td>
<td>storedVars["pdf_source"].then(function (evt) {document.getElementById("selenium_myiframe").contentDocument.body.bad_pdf_parameter = new Blob([evt.target.response || evt.target.responseText], {"type": evt.target.getResponseHeader("Content-Type")});});</td>
<td></td>
</tr>
<tr>
<td>storeEval</td>
<td>document.getElementById("selenium_myiframe").contentDocument.body.bad_pdf_parameter</td>
<td>pdf_dump</td>
</tr>
<tr>
<td>echo</td>
<td>${pdf_dump}</td>
<td></td>
</tr>
<tr>
<td>verifyNotExpression</td>
<td>${pdf_dump}</td>
<td>null</td>
</tr>
<tr>
<td>storeEval</td>
<td>function ajax(url, param) { var xhr = new XMLHttpRequest(); return new Promise(function(resolve, reject) { var k; xhr.open("POST", url, true); xhr.responseType = param.dataType || ""; if (typeof param.headers === 'object' &amp;&amp; param.headers !== null) { for (k in param.headers) { if (param.headers.hasOwnProperty(k)) { xhr.setRequestHeader(k, param.headers[k]); } } } xhr.addEventListener("load", function(e) { if (e.target.status >= 400) { return reject(e); } resolve(e); }); xhr.addEventListener("error", reject); if (typeof param.xhrFields === 'object' &amp;&amp; param.xhrFields !== null) { for (k in param.xhrFields) { if (param.xhrFields.hasOwnProperty(k)) { xhr[k] = param.xhrFields[k]; } } } xhr.send(param.data); }, function() { xhr.abort(); }); } var form_data = new FormData(); form_data.append("field_my_file", storedVars["pdf_dump"], "Template.Test.Release-001-en.pdf"); form_data.append("form_id", "File_view"); x = ajax(storedVars["url"].split("?")[0] + "/Base_edit", {"xhrFields": {"with_credentials": true}, "data": form_data});</td>
<td>promise</td>
</tr>
<tr>
<td>storeEval</td>
<td>storedVars["promise"].then(function () {document.getElementById("selenium_myiframe").src=storedVars["url"].split("?")[0]+"/File_view?portal_status_message=Data%20updated."});</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[@class="transition_message"]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Data updated.</td>
<td></td>
</tr>
<!-- generate image - template_test_release_input_page_0_001_en_bmp -->
<tr>
<td>echo</td>
<td>update => template_test_release_input_page_0_001_en_bmp</td>
<td></td>
</tr>
<tr>
<td>storeEval</td>
<td>storedVars["url"].split("?")[0]</td>
<td>screenshot_url</td>
</tr>
<tr>
<td>echo</td>
<td>${screenshot_url}</td>
<td></td>
</tr>
<tr>
<td>open</td>
<td>${screenshot_url}/Document_createScreenshot?frame=0&amp;doc_id=template_test_release_input_page_0_001_en_bmp</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Screenshot updated.</td>
<td></td>
</tr>
<!-- update 2nd pdf document - template_test_release_input_002_de_pdf -->
<tr>
<td>echo</td>
<td>update => template_test_release_input_002_de_pdf</td>
<td></td>
</tr>
<tr>
<td>open</td>
<td>${base_url}/web_page_module/</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>records</td>
<td></td>
</tr>
<tr>
<td>type</td>
<td>name=listbox_reference</td>
<td>Template.Test.Release</td>
</tr>
<tr>
<td>type</td>
<td>name=listbox_version</td>
<td>002</td>
</tr>
<tr>
<td>keyPressAndWait</td>
<td>listbox_version</td>
<td>\13</td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Template Test Release</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[contains(text(), 'Template.Test.Release')]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Short Title</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//button[@class="import_export"]</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//button[@class="import_export"]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Export Slideshow</td>
<td></td>
</tr>
<tr>
<td>selectAndWait</td>
<td>name=select_dialog</td>
<td>index=4</td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Export Release</td>
<td></td>
</tr>
<tr>
<td>select</td>
<td>name=field_format</td>
<td>index=1</td>
</tr>
<tr>
<td>type</td>
<td>name=field_override_source_organisation_title</td>
<td>Test Association</td>
</tr>
<tr>
<td>type</td>
<td>name=field_override_source_person_title</td>
<td>Test Association Member</td>
</tr>
<tr>
<td>check</td>
<td>name=field_display_about</td>
<td></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>name=Base_callDialogMethod:method</td>
<td></td>
</tr>
<tr>
<td>waitForPageToLoad</td>
<td></td>
<td></td>
</tr>
<!-- PDF viewer has no document.title, wait for "" means pdf is loaded -->
<tr>
<td>waitForTitle</td>
<td></td>
<td></td>
</tr>
<tr>
<td>verifyTitle</td>
<td></td>
<td></td>
</tr>
<!-- Store this location for re-requesting -->
<tr>
<td>storeLocation</td>
<td>url</td>
<td></td>
</tr>
<tr>
<td>echo</td>
<td>${url}</td>
<td></td>
</tr>
<!-- Can't fetch pdf source, so request page again -->
<tr>
<td>storeEval</td>
<td>function ajax(url) { var xhr = new XMLHttpRequest(); return new Promise(function(resolve, reject) { var k; xhr.open("GET", url, true); xhr.responseType = "blob", xhr.addEventListener("load", function(e) { if (e.target.status >= 400) { return reject(e); } resolve(e); }); xhr.addEventListener("error", reject); xhr.send(); }, function() { xhr.abort(); }); }; ajax(storedVars["url"] + "&amp;batch_mode=True");</td>
<td>pdf_source</td>
</tr>
<!-- pause to let the ajax request finish. now if the table was a async, queue
that would be nice, 3/6000 did not work-->
<tr>
<td>pause</td>
<td>9000</td>
<td></td>
</tr>
<tr>
<td>goBackAndWait</td>
<td></td>
<td></td>
</tr>
<tr>
<td>waitForPageToLoad</td>
<td></td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Web Pages</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[contains(text(), 'ERP5')]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//a[contains(text(), 'Documents')]</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[contains(text(), 'Documents')]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>records</td>
<td></td>
</tr>
<tr>
<td>type</td>
<td>name=listbox_reference</td>
<td>Template.Test.Release</td>
</tr>
<tr>
<td>type</td>
<td>name=listbox_version</td>
<td>002</td>
</tr>
<tr>
<td>keyPressAndWait</td>
<td>listbox_version</td>
<td>\13</td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Template Test Release</td>
<td></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>//a[contains(text(), 'Template.Test.Release')]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Short Title</td>
<td></td>
</tr>
<!-- manual form submit -->
<tr>
<td>storeLocation</td>
<td>url</td>
<td></td>
</tr>
<!-- only handle pdf_source (a promise!) here, because it needs to be set on
the iframe and a page-reload resets all (bad) parameters manually set -->
<tr>
<td>storeEval</td>
<td>storedVars["pdf_source"].then(function (evt) {document.getElementById("selenium_myiframe").contentDocument.body.bad_pdf_parameter = new Blob([evt.target.response || evt.target.responseText], {"type": evt.target.getResponseHeader("Content-Type")});});</td>
<td></td>
</tr>
<tr>
<td>storeEval</td>
<td>document.getElementById("selenium_myiframe").contentDocument.body.bad_pdf_parameter</td>
<td>pdf_dump</td>
</tr>
<tr>
<td>echo</td>
<td>${pdf_dump}</td>
<td></td>
</tr>
<tr>
<td>verifyNotExpression</td>
<td>${pdf_dump}</td>
<td>null</td>
</tr>
<tr>
<td>storeEval</td>
<td>function ajax(url, param) { var xhr = new XMLHttpRequest(); return new Promise(function(resolve, reject) { var k; xhr.open("POST", url, true); xhr.responseType = param.dataType || ""; if (typeof param.headers === 'object' &amp;&amp; param.headers !== null) { for (k in param.headers) { if (param.headers.hasOwnProperty(k)) { xhr.setRequestHeader(k, param.headers[k]); } } } xhr.addEventListener("load", function(e) { if (e.target.status >= 400) { return reject(e); } resolve(e); }); xhr.addEventListener("error", reject); if (typeof param.xhrFields === 'object' &amp;&amp; param.xhrFields !== null) { for (k in param.xhrFields) { if (param.xhrFields.hasOwnProperty(k)) { xhr[k] = param.xhrFields[k]; } } } xhr.send(param.data); }, function() { xhr.abort(); }); } var form_data = new FormData(); form_data.append("field_my_file", storedVars["pdf_dump"], "Template.Test.Release-002-de.pdf"); form_data.append("form_id", "File_view"); x = ajax(storedVars["url"].split("?")[0] + "/Base_edit", {"xhrFields": {"with_credentials": true}, "data": form_data});</td>
<td>promise</td>
</tr>
<tr>
<td>storeEval</td>
<td>storedVars["promise"].then(function () {document.getElementById("selenium_myiframe").src=storedVars["url"].split("?")[0]+"/File_view?portal_status_message=Data%20updated."});</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[@class="transition_message"]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Data updated.</td>
<td></td>
</tr>
<!-- generate image - template_test_release_input_page_0_002_de_bmp -->
<tr>
<td>echo</td>
<td>update => template_test_release_input_page_0_002_de_bmp</td>
<td></td>
</tr>
<tr>
<td>storeEval</td>
<td>storedVars["url"].split("?")[0]</td>
<td>screenshot_url</td>
</tr>
<tr>
<td>echo</td>
<td>${screenshot_url}</td>
<td></td>
</tr>
<tr>
<td>open</td>
<td>${screenshot_url}/Document_createScreenshot?frame=0&amp;doc_id=template_test_release_input_page_0_002_de_bmp</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Screenshot updated.</td>
<td></td>
</tr>
<!-- make sure print exchange works -->
<tr>
<td>echo</td>
<td>action => print</td>
<td></td>
</tr>
<tr>
<td>open</td>
<td>${base_url}/web_page_module/</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>records</td>
<td></td>
</tr>
<tr>
<td>type</td>
<td>name=listbox_reference</td>
<td>Template.Test.Release</td>
</tr>
<tr>
<td>type</td>
<td>name=listbox_version</td>
<td>001</td>
</tr>
<tr>
<td>keyPressAndWait</td>
<td>listbox_version</td>
<td>\13</td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Template Test Release</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[contains(text(), 'Template.Test.Release')]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Short Title</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//button[@class="print"]</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//button[@class="print"]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Print As Slideshow</td>
<td></td>
</tr>
<tr>
<td>selectAndWait</td>
<td>name=select_dialog</td>
<td>index=4</td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Display Automatic About</td>
<td></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>name=Base_showUpdateDialog:method</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[@class="transition_message"]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Preview updated.</td>
<td></td>
</tr>
</tbody></table>
<tr><td rowspan="1" colspan="3">Test Release Template UI</td></tr>
</thead>
<tbody>
<tal:block metal:use-macro="here/Zuite_CommonTemplate/macros/init" />
<tal:block tal:define="portal here/portal_url/getPortalObject;
caller python: getattr(context, 'Zuite_setSkipSave', None);
no_file_update python: caller() if caller is not None else True;">
<tr>
<td>open</td>
<td>${base_url}/bar_module/ListBoxZuite_reset</td>
<td></td>
</tr>
<tr>
<td>assertTextPresent</td>
<td>Reset Successfully.</td>
<td></td>
</tr>
<tr>
<td>open</td>
<td>${base_url}/Zuite_setPreferredTextEditor</td>
<td></td>
</tr>
<tr>
<td>assertTextPresent</td>
<td>Editor set to Textarea.</td>
<td></td>
</tr>
<tr>
<td>echo</td>
<td tal:content="python: ''.join(['skipping save: ', str(no_file_update)])"></td>
<td></td>
</tr>
<tal:block tal:condition="python: no_file_update == True">
<tr>
<td>open</td>
<td>${base_url}/Zuite_setConversionServerUrl</td>
<td></td>
</tr>
<tr>
<td>assertTextPresent</td>
<td>Conversion Server Url set.</td>
<td></td>
</tr>
</tal:block>
<tr>
<td>echo</td>
<td>ACTION => EXPORT</td>
<td></td>
</tr>
<!-- CASE 1 - template_test_release_output_expected_001_en_html -->
<tr>
<td>echo</td>
<td>CASE 1 => template_test_release_output_expected_001_en_html</td>
<td></td>
</tr>
<tr>
<td>open</td>
<td>${base_url}/web_page_module/</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>records</td>
<td></td>
</tr>
<tr>
<td>type</td>
<td>name=listbox_reference</td>
<td>Template.Test.Release</td>
</tr>
<tr>
<td>type</td>
<td>name=listbox_version</td>
<td>001</td>
</tr>
<tr>
<td>keyPressAndWait</td>
<td>listbox_version</td>
<td>\13</td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Template Test Release</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[contains(text(), 'Template.Test.Release')]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Short Title</td>
<td></td>
</tr>
<!-- Save once to set modification date for live tests -->
<tr>
<td>waitForElementPresent</td>
<td>//button[@class="save"]</td>
<td></td>
</tr>
<tr>
<td>verifyElementPresent</td>
<td>//button[@class="save"]</td>
<td></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>//button[@class="save"]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[@class="transition_message"]</td>
<td></td>
</tr>
<tr>
<td>assertTextPresent</td>
<td>Data updated.</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//button[@class="import_export"]</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//button[@class="import_export"]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Export Slideshow</td>
<td></td>
</tr>
<tr>
<td>selectAndWait</td>
<td>name=select_dialog</td>
<td>index=4</td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Export Release</td>
<td></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>name=Base_showUpdateDialog:method</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[@class="transition_message"]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Preview updated.</td>
<td></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>name=Base_callDialogMethod:method</td>
<td></td>
</tr>
<tr>
<td>waitForElementNotPresent</td>
<td>name=Base_callDialogMethod:method</td>
<td></td>
</tr>
<tr>
<td>waitForPageToLoad</td>
<td></td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>©</td>
<td></td>
</tr>
<tal:block tal:condition="python: no_file_update == False">
<tr>
<td>storeLocation</td>
<td>url</td>
<td></td>
</tr>
<tr>
<td>echo</td>
<td>${url}</td>
<td></td>
</tr>
<!-- Can't fetch iframe source, so request page again -->
<tr>
<td>storeEval</td>
<td>function ajax(url) {var xhr = new XMLHttpRequest();return new Promise(function(resolve, reject) {var k;xhr.open("GET", url, true);xhr.addEventListener("load", function(e) {if (e.target.status >= 400) {return reject(e);}resolve(e);});xhr.addEventListener("error", reject);xhr.send();}, function() {xhr.abort();});};ajax(storedVars["url"] + "&amp;batch_mode=True");</td>
<td>page_source</td>
</tr>
</tal:block>
<tr>
<td>goBackAndWait</td>
<td></td>
<td></td>
</tr>
<tr>
<td>waitForPageToLoad</td>
<td></td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Web Pages</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[contains(text(), 'Web Pages')]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>records</td>
<td></td>
</tr>
<tr>
<td>type</td>
<td>name=listbox_reference</td>
<td>%Template% AND %Output% AND %Release%</td>
</tr>
<tr>
<td>type</td>
<td>name=listbox_version</td>
<td>001</td>
</tr>
<tr>
<td>keyPressAndWait</td>
<td>listbox_reference</td>
<td>\13</td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Template.Test.Release.Expected.Output.Sample</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[contains(text(), 'Template.Test.Release.Expected.Output.Sample')]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Short Title</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//a/span[contains(text(), 'Edit')]</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a/span[contains(text(), 'Edit')]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[@class="input"]/div/textarea</td>
<td></td>
</tr>
<tal:block tal:condition="python: no_file_update == False">
<tr>
<td>storeEval</td>
<td>storedVars["page_source"].then(function (evt) {var content = evt.target.response || evt.target.responseText;document.getElementById("selenium_myiframe").contentDocument.body.bad_parameter = content;})</td>
<td></td>
</tr>
<tr>
<td>storeEval</td>
<td>document.getElementById("selenium_myiframe").contentDocument.body.bad_parameter;</td>
<td>dump</td>
</tr>
<tr>
<td>type</td>
<td>//div[@class="input"]/div/textarea</td>
<td>${dump}</td>
</tr>
</tal:block>
<tr>
<td>verifyElementPresent</td>
<td>//button[@class="save"]</td>
<td></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>//button[@class="save"]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[@class="transition_message"]</td>
<td></td>
</tr>
<tr>
<td>assertTextPresent</td>
<td>Data updated.</td>
<td></td>
</tr>
<!-- CASE 2 - template_test_release_output_expected_002_de_html -->
<tr>
<td>echo</td>
<td>CASE 2 => template_test_release_output_expected_002_de_html</td>
<td></td>
</tr>
<tr>
<td>verifyTextPresent</td>
<td>Web Pages</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[contains(text(), 'Web Pages')]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>records</td>
<td></td>
</tr>
<tr>
<td>type</td>
<td>name=listbox_reference</td>
<td>Template.Test.Release</td>
</tr>
<tr>
<td>type</td>
<td>name=listbox_version</td>
<td>002</td>
</tr>
<tr>
<td>keyPressAndWait</td>
<td>listbox_version</td>
<td>\13</td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Template Test Release</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[contains(text(), 'Template.Test.Release')]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Short Title</td>
<td></td>
</tr>
<!-- Save once to set modification date for live tests -->
<tr>
<td>waitForElementPresent</td>
<td>//button[@class="save"]</td>
<td></td>
</tr>
<tr>
<td>verifyElementPresent</td>
<td>//button[@class="save"]</td>
<td></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>//button[@class="save"]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[@class="transition_message"]</td>
<td></td>
</tr>
<tr>
<td>assertTextPresent</td>
<td>Data updated.</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//button[@class="import_export"]</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//button[@class="import_export"]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Export Slideshow</td>
<td></td>
</tr>
<tr>
<td>selectAndWait</td>
<td>name=select_dialog</td>
<td>index=4</td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Export Release</td>
<td></td>
</tr>
<tr>
<td>type</td>
<td>name=field_override_source_organisation_title</td>
<td>Test Association</td>
</tr>
<tr>
<td>type</td>
<td>name=field_override_source_person_title</td>
<td>Test Association Member</td>
</tr>
<tr>
<td>uncheck</td>
<td>name=field_display_about</td>
<td></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>name=Base_showUpdateDialog:method</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[@class="transition_message"]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Preview updated.</td>
<td></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>name=Base_callDialogMethod:method</td>
<td></td>
</tr>
<tr>
<td>waitForPageToLoad</td>
<td></td>
<td></td>
</tr>
<tr>
<td>waitForElementNotPresent</td>
<td>name=Base_callDialogMethod:method</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>©</td>
<td></td>
</tr>
<tal:block tal:condition="python: no_file_update == False">
<tr>
<td>storeLocation</td>
<td>url</td>
<td></td>
</tr>
<tr>
<td>echo</td>
<td>${url}</td>
<td></td>
</tr>
<!-- Can't fetch iframe source, so request page again -->
<tr>
<td>storeEval</td>
<td>function ajax(url) {var xhr = new XMLHttpRequest();return new Promise(function(resolve, reject) {var k;xhr.open("GET", url, true);xhr.addEventListener("load", function(e) {if (e.target.status >= 400) {return reject(e);}resolve(e);});xhr.addEventListener("error", reject);xhr.send();}, function() {xhr.abort();});};ajax(storedVars["url"] + "&amp;batch_mode=True");</td>
<td>page_source</td>
</tr>
</tal:block>
<tr>
<td>goBackAndWait</td>
<td></td>
<td></td>
</tr>
<tr>
<td>waitForPageToLoad</td>
<td></td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Web Pages</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[contains(text(), 'Web Pages')]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>records</td>
<td></td>
</tr>
<tr>
<td>type</td>
<td>name=listbox_reference</td>
<td>%Template% AND %Output% AND %Release%</td>
</tr>
<tr>
<td>type</td>
<td>name=listbox_version</td>
<td>002</td>
</tr>
<tr>
<td>keyPressAndWait</td>
<td>listbox_reference</td>
<td>\13</td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Template.Test.Release.Expected.Output.Sample</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[contains(text(), 'Template.Test.Release.Expected.Output.Sample')]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Short Title</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//a/span[contains(text(), 'Edit')]</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a/span[contains(text(), 'Edit')]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[@class="input"]/div/textarea</td>
<td></td>
</tr>
<tal:block tal:condition="python: no_file_update == False">
<tr>
<td>storeEval</td>
<td>storedVars["page_source"].then(function (evt) {var content = evt.target.response || evt.target.responseText;document.getElementById("selenium_myiframe").contentDocument.body.bad_parameter = content;})</td>
<td></td>
</tr>
<tr>
<td>storeEval</td>
<td>document.getElementById("selenium_myiframe").contentDocument.body.bad_parameter;</td>
<td>dump</td>
</tr>
<tr>
<td>type</td>
<td>//div[@class="input"]/div/textarea</td>
<td>${dump}</td>
</tr>
</tal:block>
<tr>
<td>verifyElementPresent</td>
<td>//button[@class="save"]</td>
<td></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>//button[@class="save"]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[@class="transition_message"]</td>
<td></td>
</tr>
<tr>
<td>assertTextPresent</td>
<td>Data updated.</td>
<td></td>
</tr>
<!-- CASE 1 (pdf) - template_test_release_input_001_en_pdf -->
<tr>
<td>echo</td>
<td>CASE 1 (pdf) => template_test_release_input_001_en_pdf</td>
<td></td>
</tr>
<tr>
<td>open</td>
<td>${base_url}/web_page_module/</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>records</td>
<td></td>
</tr>
<tr>
<td>type</td>
<td>name=listbox_reference</td>
<td>Template.Test.Release</td>
</tr>
<tr>
<td>type</td>
<td>name=listbox_version</td>
<td>001</td>
</tr>
<tr>
<td>keyPressAndWait</td>
<td>listbox_version</td>
<td>\13</td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Template Test Release</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[contains(text(), 'Template.Test.Release')]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Short Title</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//button[@class="import_export"]</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//button[@class="import_export"]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Export Slideshow</td>
<td></td>
</tr>
<tr>
<td>selectAndWait</td>
<td>name=select_dialog</td>
<td>index=4</td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Export Release</td>
<td></td>
</tr>
<tr>
<td>select</td>
<td>name=field_format</td>
<td>index=1</td>
</tr>
<tal:block tal:condition="python: no_file_update == False">
<!--
PDF viewer has no document.title, wait for "" means pdf is loaded
FIREFOX (51) will prompt to open PDF in new window = we're dead for now
-->
<tr>
<td>clickAndWait</td>
<td>name=Base_callDialogMethod:method</td>
<td></td>
</tr>
<tr>
<td>waitForPageToLoad</td>
<td></td>
<td></td>
</tr>
<tr>
<td>waitForTitle</td>
<td></td>
<td></td>
</tr>
<tr>
<td>verifyTitle</td>
<td></td>
<td></td>
</tr>
<tr>
<td>storeLocation</td>
<td>url</td>
<td></td>
</tr>
<tr>
<td>echo</td>
<td>${url}</td>
<td></td>
</tr>
<!-- Can't access pdf source inside iframe, so request page again -->
<tr>
<td>storeEval</td>
<td>function ajax(url) { var xhr = new XMLHttpRequest(); return new Promise(function(resolve, reject) { var k; xhr.open("GET", url, true); xhr.responseType = "blob"; xhr.addEventListener("load", function(e) { if (e.target.status >= 400) { return reject(e); } resolve(e); }); xhr.addEventListener("error", reject); xhr.send(); }, function() { xhr.abort(); }); }; ajax(storedVars["url"] + "&amp;batch_mode=True");</td>
<td>pdf_source</td>
</tr>
<!-- pause to let the ajax request finish. now if the table was a async, queue
that would be nice, 3/6/9000 not enough-->
<tr>
<td>pause</td>
<td>12000</td>
<td></td>
</tr>
<tr>
<td>goBackAndWait</td>
<td></td>
<td></td>
</tr>
<tr>
<td>waitForPageToLoad</td>
<td></td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Web Pages</td>
<td></td>
</tr>
</tal:block>
<tr>
<td>click</td>
<td>//a[contains(text(), 'ERP5')]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//a[contains(text(), 'Documents')]</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[contains(text(), 'Documents')]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>records</td>
<td></td>
</tr>
<tr>
<td>type</td>
<td>name=listbox_reference</td>
<td>Template.Test.Release</td>
</tr>
<tr>
<td>type</td>
<td>name=listbox_version</td>
<td>001</td>
</tr>
<tr>
<td>keyPressAndWait</td>
<td>listbox_version</td>
<td>\13</td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Template Test Release</td>
<td></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>//a[contains(text(), 'Template.Test.Release')]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Short Title</td>
<td></td>
</tr>
<tal:block tal:condition="python: no_file_update == False">
<!-- manual form submit -->
<tr>
<td>storeLocation</td>
<td>url</td>
<td></td>
</tr>
<!-- only handle pdf_source (a promise!) here, because it needs to be set on
the iframe and a page-reload resets all (bad) parameters manually set -->
<tr>
<td>storeEval</td>
<td>storedVars["pdf_source"].then(function (evt) {document.getElementById("selenium_myiframe").contentDocument.body.bad_pdf_parameter = new Blob([evt.target.response || evt.target.responseText], {"type": evt.target.getResponseHeader("Content-Type")});});</td>
<td></td>
</tr>
<tr>
<td>storeEval</td>
<td>document.getElementById("selenium_myiframe").contentDocument.body.bad_pdf_parameter</td>
<td>pdf_dump</td>
</tr>
<tr>
<td>echo</td>
<td>${pdf_dump}</td>
<td></td>
</tr>
<tr>
<td>verifyNotExpression</td>
<td>${pdf_dump}</td>
<td>null</td>
</tr>
<tr>
<td>storeEval</td>
<td>function ajax(url, param) { var xhr = new XMLHttpRequest(); return new Promise(function(resolve, reject) { var k; xhr.open("POST", url, true); xhr.responseType = param.dataType || ""; if (typeof param.headers === 'object' &amp;&amp; param.headers !== null) { for (k in param.headers) { if (param.headers.hasOwnProperty(k)) { xhr.setRequestHeader(k, param.headers[k]); } } } xhr.addEventListener("load", function(e) { if (e.target.status >= 400) { return reject(e); } resolve(e); }); xhr.addEventListener("error", reject); if (typeof param.xhrFields === 'object' &amp;&amp; param.xhrFields !== null) { for (k in param.xhrFields) { if (param.xhrFields.hasOwnProperty(k)) { xhr[k] = param.xhrFields[k]; } } } xhr.send(param.data); }, function() { xhr.abort(); }); } var form_data = new FormData(); form_data.append("field_my_file", storedVars["pdf_dump"], "Template.Test.Release-001-en.pdf"); form_data.append("form_id", "File_view"); x = ajax(storedVars["url"].split("?")[0] + "/Base_edit", {"xhrFields": {"with_credentials": true}, "data": form_data});</td>
<td>promise</td>
</tr>
<tr>
<td>storeEval</td>
<td>storedVars["promise"].then(function () {document.getElementById("selenium_myiframe").src=storedVars["url"].split("?")[0]+"/File_view?portal_status_message=Data%20updated."});</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[@class="transition_message"]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Data updated.</td>
<td></td>
</tr>
<!-- generate image - template_test_release_input_page_0_001_en_bmp -->
<tr>
<td>echo</td>
<td>update => template_test_release_input_page_0_001_en_bmp</td>
<td></td>
</tr>
<tr>
<td>storeEval</td>
<td>storedVars["url"].split("?")[0]</td>
<td>screenshot_url</td>
</tr>
<tr>
<td>echo</td>
<td>${screenshot_url}</td>
<td></td>
</tr>
<tr>
<td>open</td>
<td>${screenshot_url}/Document_createScreenshot?frame=0&amp;doc_id=template_test_release_input_page_0_001_en_bmp</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Screenshot updated.</td>
<td></td>
</tr>
</tal:block>
<!-- CASE 2 - template_test_release_input_002_de_pdf -->
<tr>
<td>echo</td>
<td>CASE 2 => template_test_release_input_002_de_pdf</td>
<td></td>
</tr>
<tr>
<td>open</td>
<td>${base_url}/web_page_module/</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>records</td>
<td></td>
</tr>
<tr>
<td>type</td>
<td>name=listbox_reference</td>
<td>Template.Test.Release</td>
</tr>
<tr>
<td>type</td>
<td>name=listbox_version</td>
<td>002</td>
</tr>
<tr>
<td>keyPressAndWait</td>
<td>listbox_version</td>
<td>\13</td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Template Test Release</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[contains(text(), 'Template.Test.Release')]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Short Title</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//button[@class="import_export"]</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//button[@class="import_export"]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Export Slideshow</td>
<td></td>
</tr>
<tr>
<td>selectAndWait</td>
<td>name=select_dialog</td>
<td>index=4</td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Export Release</td>
<td></td>
</tr>
<tr>
<td>select</td>
<td>name=field_format</td>
<td>index=1</td>
</tr>
<tr>
<td>type</td>
<td>name=field_override_source_organisation_title</td>
<td>Test Association</td>
</tr>
<tr>
<td>type</td>
<td>name=field_override_source_person_title</td>
<td>Test Association Member</td>
</tr>
<tr>
<td>check</td>
<td>name=field_display_about</td>
<td></td>
</tr>
<tal:block tal:condition="python: no_file_update == False">
<!--
PDF viewer has no document.title, wait for "" means pdf is loaded
FIREFOX (51) will prompt to open PDF in new window = we're dead for now
-->
<tr>
<td>clickAndWait</td>
<td>name=Base_callDialogMethod:method</td>
<td></td>
</tr>
<tr>
<td>waitForPageToLoad</td>
<td></td>
<td></td>
</tr>
<tr>
<td>waitForTitle</td>
<td></td>
<td></td>
</tr>
<tr>
<td>verifyTitle</td>
<td></td>
<td></td>
</tr>
<tr>
<td>storeLocation</td>
<td>url</td>
<td></td>
</tr>
<tr>
<td>echo</td>
<td>${url}</td>
<td></td>
</tr>
<!-- Can't fetch pdf source, so request page again -->
<tr>
<td>storeEval</td>
<td>function ajax(url) { var xhr = new XMLHttpRequest(); return new Promise(function(resolve, reject) { var k; xhr.open("GET", url, true); xhr.responseType = "blob", xhr.addEventListener("load", function(e) { if (e.target.status >= 400) { return reject(e); } resolve(e); }); xhr.addEventListener("error", reject); xhr.send(); }, function() { xhr.abort(); }); }; ajax(storedVars["url"] + "&amp;batch_mode=True");</td>
<td>pdf_source</td>
</tr>
<!-- pause to let the ajax request finish. now if the table was a async, queue
that would be nice, 3/6000 did not work-->
<tr>
<td>pause</td>
<td>9000</td>
<td></td>
</tr>
<tr>
<td>goBackAndWait</td>
<td></td>
<td></td>
</tr>
<tr>
<td>waitForPageToLoad</td>
<td></td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Web Pages</td>
<td></td>
</tr>
</tal:block>
<tr>
<td>click</td>
<td>//a[contains(text(), 'ERP5')]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//a[contains(text(), 'Documents')]</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[contains(text(), 'Documents')]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>records</td>
<td></td>
</tr>
<tr>
<td>type</td>
<td>name=listbox_reference</td>
<td>Template.Test.Release</td>
</tr>
<tr>
<td>type</td>
<td>name=listbox_version</td>
<td>002</td>
</tr>
<tr>
<td>keyPressAndWait</td>
<td>listbox_version</td>
<td>\13</td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Template Test Release</td>
<td></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>//a[contains(text(), 'Template.Test.Release')]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Short Title</td>
<td></td>
</tr>
<tal:block tal:condition="python: no_file_update == False">
<!-- manual form submit -->
<tr>
<td>storeLocation</td>
<td>url</td>
<td></td>
</tr>
<!-- only handle pdf_source (a promise!) here, because it needs to be set on
the iframe and a page-reload resets all (bad) parameters manually set -->
<tr>
<td>storeEval</td>
<td>storedVars["pdf_source"].then(function (evt) {document.getElementById("selenium_myiframe").contentDocument.body.bad_pdf_parameter = new Blob([evt.target.response || evt.target.responseText], {"type": evt.target.getResponseHeader("Content-Type")});});</td>
<td></td>
</tr>
<tr>
<td>storeEval</td>
<td>document.getElementById("selenium_myiframe").contentDocument.body.bad_pdf_parameter</td>
<td>pdf_dump</td>
</tr>
<tr>
<td>echo</td>
<td>${pdf_dump}</td>
<td></td>
</tr>
<tr>
<td>verifyNotExpression</td>
<td>${pdf_dump}</td>
<td>null</td>
</tr>
<tr>
<td>storeEval</td>
<td>function ajax(url, param) { var xhr = new XMLHttpRequest(); return new Promise(function(resolve, reject) { var k; xhr.open("POST", url, true); xhr.responseType = param.dataType || ""; if (typeof param.headers === 'object' &amp;&amp; param.headers !== null) { for (k in param.headers) { if (param.headers.hasOwnProperty(k)) { xhr.setRequestHeader(k, param.headers[k]); } } } xhr.addEventListener("load", function(e) { if (e.target.status >= 400) { return reject(e); } resolve(e); }); xhr.addEventListener("error", reject); if (typeof param.xhrFields === 'object' &amp;&amp; param.xhrFields !== null) { for (k in param.xhrFields) { if (param.xhrFields.hasOwnProperty(k)) { xhr[k] = param.xhrFields[k]; } } } xhr.send(param.data); }, function() { xhr.abort(); }); } var form_data = new FormData(); form_data.append("field_my_file", storedVars["pdf_dump"], "Template.Test.Release-002-de.pdf"); form_data.append("form_id", "File_view"); x = ajax(storedVars["url"].split("?")[0] + "/Base_edit", {"xhrFields": {"with_credentials": true}, "data": form_data});</td>
<td>promise</td>
</tr>
<tr>
<td>storeEval</td>
<td>storedVars["promise"].then(function () {document.getElementById("selenium_myiframe").src=storedVars["url"].split("?")[0]+"/File_view?portal_status_message=Data%20updated."});</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[@class="transition_message"]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Data updated.</td>
<td></td>
</tr>
<!-- generate image - template_test_release_input_page_0_002_de_bmp -->
<tr>
<td>echo</td>
<td>update => template_test_release_input_page_0_002_de_bmp</td>
<td></td>
</tr>
<tr>
<td>storeEval</td>
<td>storedVars["url"].split("?")[0]</td>
<td>screenshot_url</td>
</tr>
<tr>
<td>echo</td>
<td>${screenshot_url}</td>
<td></td>
</tr>
<tr>
<td>open</td>
<td>${screenshot_url}/Document_createScreenshot?frame=0&amp;doc_id=template_test_release_input_page_0_002_de_bmp</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Screenshot updated.</td>
<td></td>
</tr>
</tal:block>
<!-- make sure print exchange works -->
<tr>
<td>echo</td>
<td>ACTION => PRINT</td>
<td></td>
</tr>
<tr>
<td>open</td>
<td>${base_url}/web_page_module/</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>records</td>
<td></td>
</tr>
<tr>
<td>type</td>
<td>name=listbox_reference</td>
<td>Template.Test.Release</td>
</tr>
<tr>
<td>type</td>
<td>name=listbox_version</td>
<td>001</td>
</tr>
<tr>
<td>keyPressAndWait</td>
<td>listbox_version</td>
<td>\13</td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Template Test Release</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[contains(text(), 'Template.Test.Release')]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Short Title</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//button[@class="print"]</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//button[@class="print"]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Print As Slideshow</td>
<td></td>
</tr>
<tr>
<td>selectAndWait</td>
<td>name=select_dialog</td>
<td>index=4</td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Display Automatic About</td>
<td></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>name=Base_showUpdateDialog:method</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[@class="transition_message"]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Preview updated.</td>
<td></td>
</tr>
</tal:block>
</tbody>
</table>
</body>
</html>
\ No newline at end of file
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Support Request" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_Access_contents_information_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Modify_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>_View_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>categories</string> </key>
<value>
<tuple>
<string>destination_section/organisation_module/template_test_organisation</string>
<string>destination_decision/person_module/template_test_recipient</string>
<string>source_decision/person_module/template_test_sender</string>
<string>source_trade/person_module/template_test_no_member</string>
</tuple>
</value>
</item>
<item>
<key> <string>default_reference</string> </key>
<value> <string>Template.Test.Support.Request</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string>Test support requests for sending templates.</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>template_test_support_request_001</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Support Request</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Template Test Support Request</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<section>
<table>
<thead>
<tr>
<th colspan="4">签收单</th>
</tr>
<tr>
<th>姓名</th>
<th>职位<br />
公司</th>
<th>签名</th>
<th>日期</th>
</tr>
</thead>
<tbody>
<tr>
<td><strong>John Doe</strong></td>
<td>总经理, 讯空间大数据科技</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td><b>Jane Donaghue</b></td>
<td>销售副总裁</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td><strong>Foo Man Chu</strong></td>
<td>CEO, Kontrabass</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
</tbody>
</table>
</section>
<section>
<table>
<thead>
<tr>
<th>分发列表</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<ul>
<li>
<p>John Doe</p>
<p>CEO, 讯空间大数据科技</p>
</li>
<li>
<p>Jane Donaghue</p>
</li>
</ul>
<ul>
<li>
<p>Foo Man Chu</p>
<p>CEO, Kontrabass</p>
</li>
</ul>
</td>
</tr>
</tbody>
</table>
</section>
<section>
<table>
<thead>
<tr>
<th colspan="4">版本列表</th>
</tr>
<tr>
<th>版本</th>
<th>日期</th>
<th>页数</th>
<th>编辑描述</th>
</tr>
</thead>
<tbody>
<tr>
<td>001</td>
<td>2018-5-15</td>
<td>全页</td>
<td>创建内容</td>
</tr>
<tr>
<td>002</td>
<td>2018-5-28</td>
<td>附录四</td>
<td>添加附录四</td>
</tr>
<tr>
<td>003</td>
<td>2018-6-1</td>
<td>全页</td>
<td>修改和完善</td>
</tr>
</tbody>
</table>
</section>
${WebPage_insertTableOfReferences}
<h1>Synthese</h1>
<p>This document is a high level overview measures taken by Foo for Bar project. </p>
<p>
......@@ -98,7 +202,7 @@ which should not be touched.
<td>123</td>
<td>456</td>
<td>Some text</td>
<td>More description</td>
<td style="text-align: center">More description</td>
</tr>
</tbody>
<caption>Table description</caption>
......
......@@ -93,7 +93,111 @@
<section class="ci-book-table-of-content"><p class="ci-book-toc-faux-h1">Table of Contents</p><ol><li><div><a href="#synthese_anchor">Synthese</div></a><ol><li><div><a href="#risks-and-measures_anchor">Risks and measures</div></a><ol><li><div><a href="#risk-of-casualties-if-device-does-not-stop-and-destroys-itself_anchor">Risk of casualties if device does not stop and destroys itself</div></a></li><li><div><a href="#risk-of-killing-birds-and-polluting-the-environment_anchor">Risk of killing birds and polluting the environment</div></a></li><li><div><a href="#noise-and-vibration-levels_anchor">Noise and vibration levels</div></a></li></ol></li></ol><li><div><a href="#reports_anchor">Reports</div></a><ol><li><div><a href="#project-reports_anchor">Project Reports</div></a></li><li><div><a href="#sale-order-reports_anchor">Sale Order Reports</div></a></ol></ol></section>
<h1><a name="synthese_anchor"></a>Synthese<a class="custom-para" href=Template.Test.Book#synthese><span style="font-size:.75em;line-height:1em;padding-left:.5em;">&para;</span></a></h1>
<section>
<table>
<thead>
<tr>
<th colspan="4">签收单</th>
</tr>
<tr>
<th>姓名</th>
<th>职位<br />
公司</th>
<th>签名</th>
<th>日期</th>
</tr>
</thead>
<tbody>
<tr>
<td><strong>John Doe</strong></td>
<td>总经理, 讯空间大数据科技</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td><b>Jane Donaghue</b></td>
<td>销售副总裁</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td><strong>Foo Man Chu</strong></td>
<td>CEO, Kontrabass</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
</tbody>
</table>
</section>
<section>
<table>
<thead>
<tr>
<th>分发列表</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<ul>
<li>
<p>John Doe</p>
<p>CEO, 讯空间大数据科技</p>
</li>
<li>
<p>Jane Donaghue</p>
</li>
</ul>
<ul>
<li>
<p>Foo Man Chu</p>
<p>CEO, Kontrabass</p>
</li>
</ul>
</td>
</tr>
</tbody>
</table>
</section>
<section>
<table>
<thead>
<tr>
<th colspan="4">版本列表</th>
</tr>
<tr>
<th>版本</th>
<th>日期</th>
<th>页数</th>
<th>编辑描述</th>
</tr>
</thead>
<tbody>
<tr>
<td>001</td>
<td>2018-5-15</td>
<td>全页</td>
<td>创建内容</td>
</tr>
<tr>
<td>002</td>
<td>2018-5-28</td>
<td>附录四</td>
<td>添加附录四</td>
</tr>
<tr>
<td>003</td>
<td>2018-6-1</td>
<td>全页</td>
<td>修改和完善</td>
</tr>
</tbody>
</table>
</section>
<h1><a name="synthese_anchor"></a>Synthese<a class="custom-para" href=Template.Test.Book#synthese><span style="font-size:.75em;line-height:1em;padding-left:.5em;">&para;</span></a></h1>
<p>This document is a high level overview measures taken by Foo for Bar project. </p>
<p>
The purpose of this document is to show possible dangers and measures being
......@@ -193,7 +297,7 @@ which should not be touched.
<td>123</td>
<td>456</td>
<td>Some text</td>
<td>More description</td>
<td style="text-align: center">More description</td>
</tr>
</tbody>
<caption>Table description</caption>
......
......@@ -164,7 +164,7 @@
<td width="15%">001</td>
<td width="20%">20xx-xx-xx</td>
<td width="15%">All</td>
<td width="55%" style="text-align: left">Added example content, corrections.</td>
<td width="55%" style="text-align: right">Added example content, corrections.</td>
</tr>
</tbody>
......@@ -176,7 +176,109 @@
<section class="ci-book-table-of-content"><p class="ci-book-toc-faux-h1">Table of Contents</p><ol><li><div><a href="#introduction_anchor">Introduction</div></a><ol><li><div><a href="#references_anchor">References</div></a><ol><li><div><a href="#applicable-documents_anchor">Applicable Documents</div></a></li><li><div><a href="#referenced-documents_anchor">Referenced Documents</div></a></li></ol><li><div><a href="#abbreviations_anchor">Abbreviations</div></a></li><li><div><a href="#figures_anchor">Figures</div></a></li><li><div><a href="#tables_anchor">Tables</div></a></li></ol><li><div><a href="#synthese_anchor">Synthese</div></a><ol><li><div><a href="#risks-and-measures_anchor">Risks and measures</div></a><ol><li><div><a href="#risk-of-casualties-if-device-does-not-stop-and-destroys-itself_anchor">Risk of casualties if device does not stop and destroys itself</div></a></li><li><div><a href="#risk-of-killing-birds-and-polluting-the-environment_anchor">Risk of killing birds and polluting the environment</div></a></li><li><div><a href="#noise-and-vibration-levels_anchor">Noise and vibration levels</div></a></li></ol></li></ol><li><div><a href="#header-embedded-document_anchor">Header Embedded Document</div></a><ol><li><div><a href="#header-embedded-document-content-examples_anchor">Header Embedded Document content Examples</div></a></li></ol><li><div><a href="#reports_anchor">Reports</div></a><ol><li><div><a href="#project-reports_anchor">Project Reports</div></a></li><li><div><a href="#sale-order-reports_anchor">Sale Order Reports</div></a></ol></ol></section>
<h1><a name="introduction_anchor"></a>Introduction<a class="custom-para" href=P-XYZ-Foobar#introduction><span style="font-size:.75em;line-height:1em;padding-left:.5em;">&para;</span></a></h1>
<section>
<table>
<thead>
<tr>
<th colspan="4">签收单</th>
</tr>
<tr>
<th>姓名</th>
<th>职位<br />
公司</th>
<th>签名</th>
<th>日期</th>
</tr>
</thead>
<tbody>
<tr>
<td><strong>John Doe</strong></td>
<td>总经理, 讯空间大数据科技</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td><b>Jane Donaghue</b></td>
<td>销售副总裁</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td><strong>Foo Man Chu</strong></td>
<td>CEO, Kontrabass</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
</tbody>
</table>
</section>
<section>
<table>
<thead>
<tr>
<th>分发列表</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<ul>
<li>
<p>John Doe</p>
<p>CEO, 讯空间大数据科技</p>
</li>
<li>
<p>Jane Donaghue</p>
</li>
</ul>
<ul>
<li>
<p>Foo Man Chu</p>
<p>CEO, Kontrabass</p>
</li>
</ul>
</td>
</tr>
</tbody>
</table>
</section>
<section>
<table>
<thead>
<tr>
<th colspan="4">版本列表</th>
</tr>
<tr>
<th>版本</th>
<th>日期</th>
<th>页数</th>
<th>编辑描述</th>
</tr>
</thead>
<tbody>
<tr>
<td>001</td>
<td>2018-5-15</td>
<td>全页</td>
<td>创建内容</td>
</tr>
<tr>
<td>002</td>
<td>2018-5-28</td>
<td>附录四</td>
<td>添加附录四</td>
</tr>
<tr>
<td>003</td>
<td>2018-6-1</td>
<td>全页</td>
<td>修改和完善</td>
</tr>
</tbody>
</table>
</section><h1><a name="introduction_anchor"></a>Introduction<a class="custom-para" href=P-XYZ-Foobar#introduction><span style="font-size:.75em;line-height:1em;padding-left:.5em;">&para;</span></a></h1>
<h2><a name="references_anchor"></a>References<a class="custom-para" href=P-XYZ-Foobar#references><span style="font-size:.75em;line-height:1em;padding-left:.5em;">&para;</span></a></h2>
<p>This section provides the list of applicable documents and references.</p>
<h3><a name="applicable-documents_anchor"></a>Applicable Documents<a class="custom-para" href=P-XYZ-Foobar#applicable-documents><span style="font-size:.75em;line-height:1em;padding-left:.5em;">&para;</span></a></h3>
......@@ -327,7 +429,9 @@
</tbody>
</table><h1><a name="synthese_anchor"></a>Synthese<a class="custom-para" href=P-XYZ-Foobar#synthese><span style="font-size:.75em;line-height:1em;padding-left:.5em;">&para;</span></a></h1>
</table>
<h1><a name="synthese_anchor"></a>Synthese<a class="custom-para" href=P-XYZ-Foobar#synthese><span style="font-size:.75em;line-height:1em;padding-left:.5em;">&para;</span></a></h1>
<p>This document is a high level overview measures taken by Foo for Bar project. </p>
<p>
The purpose of this document is to show possible dangers and measures being
......@@ -432,7 +536,7 @@ which should not be touched.
<td>123</td>
<td>456</td>
<td>Some text</td>
<td>More description</td>
<td style="text-align: center">More description</td>
</tr>
</tbody>
<a href="#TBL-1"></a><caption>TBL-1 - Table description</caption>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Folder" module="OFS.Folder"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_local_properties</string> </key>
<value>
<tuple>
<dictionary>
<item>
<key> <string>id</string> </key>
<value> <string>business_template_skin_layer_priority</string> </value>
</item>
<item>
<key> <string>type</string> </key>
<value> <string>float</string> </value>
</item>
</dictionary>
</tuple>
</value>
</item>
<item>
<key> <string>_objects</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>business_template_skin_layer_priority</string> </key>
<value> <float>50.0</float> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>erp5_corporate_identity_test</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
"""
================================================================================
Set preference for template test to textarea
================================================================================
"""
# parameters (* default)
# ------------------------------------------------------------------------------
# make sure cloudooo is set for pdf conversions on system_preference
conversion_server_url_list = context.portal_preferences.getPreferredDocumentConversionServerUrlList() or ["https://cloudooo.erp5.net"]
system_preference = context.portal_preferences.default_system_preference
system_preference.setPreferredDocumentConversionServerUrlList(conversion_server_url_list)
return "Conversion Server Url set."
<?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>id</string> </key>
<value> <string>Zuite_setConversionServerUrl</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
"""
================================================================================
Set preference for template test to textarea
================================================================================
"""
# parameters (* default)
# ------------------------------------------------------------------------------
# force text_area editor
context.Zuite_setPreference('')
preference = context.portal_preferences.erp5_ui_test_preference
preference.setPreferredTextEditor('text_area')
return "Editor set to Textarea."
<?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>id</string> </key>
<value> <string>Zuite_setPreferredTextEditor</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
"""
================================================================================
Add this script to custom skin selection to update test comparison files
================================================================================
"""
# parameters (* default)
# ------------------------------------------------------------------------------
return True
<?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>id</string> </key>
<value> <string>xxxZuite_setSkipSave</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
##############################################################################
#
# Copyright (c) 2002-2017 Nexedi SA and Contributors. All Rights Reserved.
# Copyright (c) 2002-2018 Nexedi SA and Contributors. All Rights Reserved.
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsibility of assessing all potential
......@@ -212,7 +212,7 @@ class TestCorporateIdentityTemplateList(ERP5TypeTestCase):
if dump:
expected_page.edit(text_content=html)
self.tic()
self.assertEquals(html, expected_page.getData())
self.assertEquals(html.encode('UTF-8'), expected_page.getData())
def runPdfTestPattern(self, id1, id2, id3, **kw):
"""
......
##############################################################################
#
# Copyright (c) 2002-2018 Nexedi SA and Contributors. All Rights Reserved.
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsibility of assessing all potential
# consequences resulting from its eventual inadequacies and bugs
# End users who are looking for a ready-to-use solution with commercial
# guarantees and support are strongly adviced to contract a Free Software
# Service Company
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
##############################################################################
import unittest
from Products.ERP5Type.tests.ERP5TypeFunctionalTestCase import ERP5TypeFunctionalTestCase
class TestFunctionalCorporateIdentityTemplateList(ERP5TypeFunctionalTestCase):
foreground = 0
run_only = "template_test_zuite"
def getBusinessTemplateList(self):
return (
'erp5_corporate_identity',
'erp5_corporate_identity_test',
'erp5_ui_test_core',
'erp5_ui_test',
)
def test_suite():
suite = unittest.TestSuite()
suite.addTest(unittest.makeSuite(TestFunctionalCorporateIdentityTemplateList))
return suite
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Test Component" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_recorded_property_dict</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>default_reference</string> </key>
<value> <string>testFunctionalCorporateIdentityTemplateList</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string>Tests for the corporate identity templates classic user interface.</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>test.erp5.testFunctionalCorporateIdentityTemplateList</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Test Component</string> </value>
</item>
<item>
<key> <string>sid</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>text_content_error_message</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>text_content_warning_message</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>version</string> </key>
<value> <string>erp5</string> </value>
</item>
<item>
<key> <string>workflow_history</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary>
<item>
<key> <string>component_validation_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="4" aka="AAAAAAAAAAQ=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.patches.WorkflowTool"/>
</pickle>
<pickle>
<tuple>
<none/>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>validate</string> </value>
</item>
<item>
<key> <string>validation_state</string> </key>
<value> <string>validated</string> </value>
</item>
</dictionary>
</list>
</tuple>
</pickle>
</record>
</ZopeData>
erp5_corporate_identity
erp5_ui_test_core
erp5_ui_test
erp5_test_result
erp5_full_text_mroonga_catalog
erp5_corporate_identity
\ No newline at end of file
erp5_ui_test
\ No newline at end of file
Test and output files used for portal component tests of erp5_corporate_identity
\ No newline at end of file
Test and output files used for portal component tests of erp5_corporate_identity. Tests.
\ No newline at end of file
......@@ -7,4 +7,5 @@ person_module/template_test*
person_module/template_test*/default**
web_page_module/template_test_*
portal_tests/template_test_zuite
portal_tests/template_test_zuite/testAndUpdateTest*
\ No newline at end of file
portal_tests/template_test_zuite/testAndUpdateTest*
support_request_module/template_test_*
\ No newline at end of file
......@@ -9,4 +9,5 @@ portal_categories/function/company
portal_categories/function/company/executive
portal_tests/template_test_zuite
portal_tests/template_test_zuite/testAndUpdateTest*
support_request_module/template_test_*
web_page_module/template_test_*
\ No newline at end of file
erp5_corporate_identity_test
\ No newline at end of file
test.erp5.testCorporateIdentityTemplateList
\ No newline at end of file
test.erp5.testCorporateIdentityTemplateList
test.erp5.testFunctionalCorporateIdentityTemplateList
\ No newline at end of file
erp5_full_text_mroonga_catalog
\ 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