Commit bec213dc authored by Roque's avatar Roque

erp5_web_project_ui_test: front page test in detail

parent a4075c8f
......@@ -63,7 +63,13 @@
<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"
<!-- Check draft project -->
<tr>
<td>assertElementNotPresent</td>
<td>//div[@class='front-project-list']//div[@class='project-title']//a[text()='draft-project']</td>
<td></td>
</tr>
<!-- Check empty project -->
<tr>
<td>assertElementPresent</td>
<td>//div[@class='front-project-list']//div[@class='project-title']//a[text()='empty-project']</td>
......@@ -149,36 +155,114 @@
<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
<!-- Check documented project -->
<tr>
<td>assertElementPresent</td>
<td>//div[@class='front-project-list']//div[@class='project-title']//a[text()='documented-project']</td>
<td></td>
</tr>
<!-- Check Task line -->
<tr>
<td>assertElementPresent</td>
<td>//div[@class='front-project-list']//div[@class='project-line']//span[@class='status none margined green' and contains(@id, 'documented-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='ui-visible' and contains(@id, 'documented-project') and contains(@id, 'Task') and contains(@id, '-number')]</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//div[@class='front-project-list']//div[@class='project-line']//span[contains(@id, 'documented-project') and contains(@id, 'Task') and contains(@id, '-total') and text()='3']</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//div[@class='front-project-list']//div[@class='project-line']//span[contains(@id, 'documented-project') and contains(@id, 'Task') and contains(@id, '-outdated') and text()='0']</td>
<td></td>
</tr>
<!-- Check Bug line -->
<tr>
<td>assertElementPresent</td>
<td>//div[@class='front-project-list']//div[@class='project-line']//span[@class='status none margined green' and contains(@id, 'documented-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='ui-visible' and contains(@id, 'documented-project') and contains(@id, 'Bug') and contains(@id, '-number')]</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//div[@class='front-project-list']//div[@class='project-line']//span[contains(@id, 'documented-project') and contains(@id, 'Bug') and contains(@id, '-total') and text()='3']</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//div[@class='front-project-list']//div[@class='project-line']//span[contains(@id, 'documented-project') and contains(@id, 'Bug') and contains(@id, '-outdated') and text()='0']</td>
<td></td>
</tr>
<!-- Check Test Result line -->
<tr>
<td>assertElementPresent</td>
<td>//div[@class='front-project-list']//div[@class='project-line']//span[@class='status none margined green' and contains(@id, 'documented-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='ui-visible' and contains(@id, 'documented-project') and contains(@id, 'Test-Result') and contains(@id, '-number')]</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//div[@class='front-project-list']//div[@class='project-line']//span[contains(@id, 'documented-project') and contains(@id, 'Test-Result') and contains(@id, '-total') and text()='20']</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//div[@class='front-project-list']//div[@class='project-line']//span[contains(@id, 'documented-project') and contains(@id, 'Test-Result') and contains(@id, '-outdated') and text()='0']</td>
<td></td>
</tr>
<!-- Check Milestone line -->
<tr>
<td>assertElementPresent</td>
<td>//div[@class='front-project-list']//div[@class='project-line']//span[@class='status none margined green' and contains(@id, 'documented-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='ui-visible' and contains(@id, 'documented-project') and contains(@id, 'Milestone') and contains(@id, '-number')]</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//div[@class='front-project-list']//div[@class='project-line']//span[contains(@id, 'documented-project') and contains(@id, 'Milestone') and contains(@id, '-total') and text()='1']</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//div[@class='front-project-list']//div[@class='project-line']//span[contains(@id, 'documented-project') and contains(@id, 'Milestone') and contains(@id, '-outdated') and text()='0']</td>
<td></td>
</tr>
<!-- Check Task Report line -->
<tr>
<td>assertElementPresent</td>
<td>//div[@class='front-project-list']//div[@class='project-line']//span[@class='status none margined green' and contains(@id, 'documented-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='ui-visible' and contains(@id, 'documented-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[contains(@id, 'documented-project') and contains(@id, 'Task-Report') and contains(@id, '-total') and text()='3']</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//div[@class='front-project-list']//div[@class='project-line']//span[contains(@id, 'documented-project') and contains(@id, 'Task-Report') and contains(@id, '-outdated') and text()='0']</td>
<td></td>
</tr>
\ No newline at end of file
......@@ -26,6 +26,172 @@ if home_page:
home_page.publishAlive()
if create_project_documents:
# MILESTONES
project.newContent(id = test_id + "-1",
portal_type = 'Project Milestone',
reference = 'test-project-milestone')
# TASKS
module = portal.getDefaultModule('Task')
task = module.newContent(id = test_id + "-1",
portal_type = 'Task',
reference = 'lonely-task')
task.plan()
task = module.newContent(id = test_id + "-2",
portal_type = 'Task',
reference = 'task-' + project_reference,
source_project_value = project)
task = module.newContent(id = test_id + "-3",
portal_type = 'Task',
reference = 'task-' + project_reference,
source_project_value = project)
task.order()
task = module.newContent(id = test_id + "-4",
portal_type = 'Task',
reference = 'task-' + project_reference,
source_project_value = project)
task.confirm()
task = module.newContent(id = test_id + "-5",
portal_type = 'Task',
reference = 'task-' + project_reference,
source_project_value = project)
task.cancel()
task = module.newContent(id = test_id + "-6",
portal_type = 'Task',
reference = 'task-' + project_reference,
source_project_value = project)
task.delete()
task = module.newContent(id = test_id + "-7",
portal_type = 'Task',
reference = 'task-' + project_reference,
source_project_value = project)
task.plan()
# BUGS
module = portal.getDefaultModule('Bug')
bug = module.newContent(id = test_id + "-1",
portal_type = 'Bug',
reference = 'lonely-bug')
bug.confirm()
bug = module.newContent(id = test_id + "-2",
portal_type = 'Bug',
reference = 'bug-' + project_reference,
source_project_value = project)
bug = module.newContent(id = test_id + "-3",
portal_type = 'Bug',
reference = 'bug-' + project_reference,
source_project_value = project)
bug.confirm()
bug = module.newContent(id = test_id + "-4",
portal_type = 'Bug',
reference = 'bug-' + project_reference,
source_project_value = project)
bug.confirm()
bug.stop()
bug = module.newContent(id = test_id + "-5",
portal_type = 'Bug',
reference = 'bug-' + project_reference,
source_project_value = project)
bug.confirm()
bug.setReady()
bug = module.newContent(id = test_id + "-6",
portal_type = 'Bug',
reference = 'bug-' + project_reference,
source_project_value = project)
bug.confirm()
bug.cancel()
bug = module.newContent(id = test_id + "-7",
portal_type = 'Bug',
reference = 'bug-' + project_reference,
source_project_value = project)
bug.delete()
bug = module.newContent(id = test_id + "-8",
portal_type = 'Bug',
reference = 'bug-' + project_reference,
source_project_value = project)
bug.confirm()
bug.stop()
bug.deliver()
# TASK REPORTS
module = portal.getDefaultModule('Task Report')
task_report = module.newContent(id = test_id + "-1",
portal_type = 'Task Report',
reference = 'lonely-task-report')
task_report.confirm()
task_report = module.newContent(id = test_id + "-2",
portal_type = 'Task Report',
reference = 'task-report-' + project_reference,
source_project_value = project)
task_report = module.newContent(id = test_id + "-3",
portal_type = 'Task Report',
reference = 'task-report-' + project_reference,
source_project_value = project)
task_report.confirm()
task_report = module.newContent(id = test_id + "-4",
portal_type = 'Task Report',
reference = 'task-report-' + project_reference,
source_project_value = project)
task_report.stop()
task_report = module.newContent(id = test_id + "-5",
portal_type = 'Task Report',
reference = 'task-report-' + project_reference,
source_project_value = project)
task_report.confirm()
task_report.start()
task_report = module.newContent(id = test_id + "-6",
portal_type = 'Task Report',
reference = 'task-report-' + project_reference,
source_project_value = project)
task_report.stop()
task_report.deliver()
task_report = module.newContent(id = test_id + "-7",
portal_type = 'Task Report',
reference = 'task-report-' + project_reference,
source_project_value = project)
task_report.delete()
task_report = module.newContent(id = test_id + "-8",
portal_type = 'Task Report',
reference = 'task-report-' + project_reference,
source_project_value = project)
task_report.cancel()
# TEST RESULTS
module = context.portal_catalog.getDefaultModule('Test Result')
test_result = module.newContent(id = test_id + "-1",
portal_type = 'Test Result',
source_project_value = project)
test_result.newContent(id = "1",
portal_type = 'Test Result Line',
reference = "test-result-line")
test_result = module.newContent(id = test_id + "-2",
portal_type = 'Test Result',
source_project_value = project)
test_result.newContent(id = "1",
portal_type = 'Test Result Line',
reference = "test-result-line")
test_result.start()
test_result = module.newContent(id = test_id + "-3",
portal_type = 'Test Result',
source_project_value = project)
test_result.newContent(id = "1",
portal_type = 'Test Result Line',
reference = "test-result-line")
test_result.start()
test_result.fail()
test_result = module.newContent(id = test_id + "-4",
portal_type = 'Test Result',
source_project_value = project)
test_result_line = test_result.newContent(id = "1",
portal_type = 'Test Result Line',
reference = "test-result-line")
test_result_line.start()
test_result_line.stop(test_count=20)
import time
time.sleep(5)
test_result.start()
test_result.stop()
#tr_line.stop(error_count=2, failure_count=2)#, command=test_details, stdout=error_message, stderr=error_message)
# EMPTY PROJECT
module = portal.getDefaultModule('Project')
empty_project = module.newContent(id = "empty-project-" + date_time,
......@@ -39,6 +205,5 @@ if create_project_documents:
portal_type = 'Project',
reference = "draf-project")
print "Project Created"
return printed
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