Commit a4075c8f authored by Roque's avatar Roque

erp5_web_project_ui_test: new front page test

parent 67690962
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ZopePageTemplate" module="Products.PageTemplates.ZopePageTemplate"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>text/html</string> </value>
</item>
<item>
<key> <string>expand</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>testRenderjsFrontPage</string> </value>
</item>
<item>
<key> <string>output_encoding</string> </key>
<value> <string>utf-8</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <unicode></unicode> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<html xmlns:tal="http://xml.zope.org/namespaces/tal"
xmlns:metal="http://xml.zope.org/namespaces/metal">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Test RenderJS UI</title>
</head>
<body>
<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" />
<!-- Clean Up -->
<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>
<!-- Initialize -->
<tr>
<td>open</td>
<td>${base_url}/portal_skins/erp5_web_project_test/ERP5Site_createTestStartedProject?create_project_documents=true</td>
<td></td>
</tr>
<tr>
<td>assertTextPresent</td>
<td>Project Created</td>
<td></td>
</tr>
<tr>
<td>open</td>
<td>${base_url}/portal_skins/erp5_web_project_test/ERP5Site_createTestStartedProject</td>
<td></td>
</tr>
<tr>
<td>assertTextPresent</td>
<td>Project Created</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplate/macros/wait_for_activities" />
<tr>
<td>open</td>
<td>${base_url}/web_site_module/project_management/</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_app_loaded" />
<tr>
<td>assertElementPresent</td>
<td>//div[@data-gadget-url='${base_url}/web_site_module/project_management/gadget_erp5_page_project_front_page.html']</td>
<td></td>
</tr>
<!-- Check project list elements -->
<tr>
<td>waitForElementPresent</td>
<td>//div[@class='front-project-list']</td>
<td></td>
</tr>
<!-- Check empty project --> id="project_module-empty-project-03-04-2020-13-20-06-Test-Result-status"
<tr>
<td>assertElementPresent</td>
<td>//div[@class='front-project-list']//div[@class='project-title']//a[text()='empty-project']</td>
<td></td>
</tr>
<!-- Check empty Task line -->
<tr>
<td>assertElementPresent</td>
<td>//div[@class='front-project-list']//div[@class='project-line']//span[@class='status none margined' and contains(@id, 'empty-project') and contains(@id, 'Task') and contains(@id, '-status')]</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//div[@class='front-project-list']//div[@class='project-line']//span[@class='name margined' and contains(@id, 'empty-project') and text()='Tasks']</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//div[@class='front-project-list']//div[@class='project-line']//span[@class='ui-hidden' and contains(@id, 'empty-project') and contains(@id, 'Task') and contains(@id, '-number')]</td>
<td></td>
</tr>
<!-- Check empty Bug line -->
<tr>
<td>assertElementPresent</td>
<td>//div[@class='front-project-list']//div[@class='project-line']//span[@class='status none margined' and contains(@id, 'empty-project') and contains(@id, 'Bug') and contains(@id, '-status')]</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//div[@class='front-project-list']//div[@class='project-line']//span[@class='name margined' and contains(@id, 'empty-project') and text()='Bugs']</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//div[@class='front-project-list']//div[@class='project-line']//span[@class='ui-hidden' and contains(@id, 'empty-project') and contains(@id, 'Bug') and contains(@id, '-number')]</td>
<td></td>
</tr>
<!-- Check empty Test Result line -->
<tr>
<td>assertElementPresent</td>
<td>//div[@class='front-project-list']//div[@class='project-line']//span[@class='status none margined' and contains(@id, 'empty-project') and contains(@id, 'Test-Result') and contains(@id, '-status')]</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//div[@class='front-project-list']//div[@class='project-line']//span[@class='name margined' and contains(@id, 'empty-project') and text()='Test Results']</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//div[@class='front-project-list']//div[@class='project-line']//span[@class='ui-hidden' and contains(@id, 'empty-project') and contains(@id, 'Test-Result') and contains(@id, '-number')]</td>
<td></td>
</tr>
<!-- Check empty Milestone line -->
<tr>
<td>assertElementPresent</td>
<td>//div[@class='front-project-list']//div[@class='project-line']//span[@class='status none margined' and contains(@id, 'empty-project') and contains(@id, 'Milestone') and contains(@id, '-status')]</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//div[@class='front-project-list']//div[@class='project-line']//span[@class='name margined' and contains(@id, 'empty-project') and text()='Milestones']</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//div[@class='front-project-list']//div[@class='project-line']//span[@class='ui-hidden' and contains(@id, 'empty-project') and contains(@id, 'Milestone') and contains(@id, '-number')]</td>
<td></td>
</tr>
<!-- Check empty Task Report line -->
<tr>
<td>assertElementPresent</td>
<td>//div[@class='front-project-list']//div[@class='project-line']//span[@class='status none margined' and contains(@id, 'empty-project') and contains(@id, 'Task-Report') and contains(@id, '-status')]</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//div[@class='front-project-list']//div[@class='project-line']//span[@class='name margined' and contains(@id, 'empty-project') and text()='Task Reports']</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//div[@class='front-project-list']//div[@class='project-line']//span[@class='ui-hidden' and contains(@id, 'empty-project') and contains(@id, 'Task-Report') and contains(@id, '-number')]</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//div[@class='front-project-list']//div[@class='project-line']//span[text()='0' and @class='margined']</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//div[@class='front-project-list']//div[@class='project-line']//span[text()='0' and contains(@id, 'outdated')]</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//div[@class='front-project-list']//div[@class='project-line']//span[text()='(']</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//div[@class='front-project-list']//div[@class='project-line']//span[text()=')']</td>
<td></td>
</tr>
<!--
<td>//div[@data-gadget-url='${base_url}/web_site_module/project_management/gadget_erp5_project_panel.html']//a[text()='Projects' and contains(@href, '#!display_stored_state') and contains(@href, 'n.jio_key=project_module')]</td>
@id='milestone_link
<div class="project-line"><span class="status none margined" id="project_module-test-project-02-27-2020-15-02-52-Task-status"></span><span class="name margined">Tasks</span><span class="margined" id="project_module-test-project-02-27-2020-15-02-52-Task-total">0</span><span>(</span><span id="project_module-test-project-02-27-2020-15-02-52-Task-outdated">0</span><span>)</span></div>
-->
\ No newline at end of file
......@@ -2,8 +2,9 @@ portal = context.getPortalObject()
from datetime import datetime
now = datetime.now()
date_time = now.strftime("%m-%d-%Y-%H-%M-%S")
test_id = "test-project-" + date_time
project_reference = 'test-project-home' if home_page else 'test-project'
test_id = "documented-project-" if create_project_documents else "test-project-"
test_id += date_time
project_reference = 'test-project-home' if home_page else 'documented-project' if create_project_documents else 'test-project'
page_reference = 'test-home-page-' + date_time
module = portal.getDefaultModule('Project')
......@@ -24,5 +25,20 @@ if home_page:
follow_up_value = project)
home_page.publishAlive()
if create_project_documents:
# EMPTY PROJECT
module = portal.getDefaultModule('Project')
empty_project = module.newContent(id = "empty-project-" + date_time,
portal_type = 'Project',
reference = "empty-project")
empty_project.validate()
# DRAFT PROJECT
module = portal.getDefaultModule('Project')
empty_project = module.newContent(id = "draf-project-" + date_time,
portal_type = 'Project',
reference = "draf-project")
print "Project Created"
return printed
......@@ -50,7 +50,7 @@
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>home_page=False</string> </value>
<value> <string>home_page=False, create_project_documents=False</string> </value>
</item>
<item>
<key> <string>id</string> </key>
......
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