Added searching and reports for case runs

git-svn-id: svn://10.0.0.236/trunk@214277 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
ghendricks%novell.com
2006-10-27 23:43:31 +00:00
parent 7f58ec4dfa
commit 233077bb2c
21 changed files with 801 additions and 173 deletions

View File

@@ -138,7 +138,7 @@ sub init {
$columns{'component'} = "map_case_components.name";
$columns{'category'} = "map_categories.name";
$columns{'isautomated'} = "test_cases.isautomated";
$columns{'tags'} = "map_case_tags.name";
$columns{'tags'} = "map_case_tags.tag_name";
$columns{'requirement'} = "test_cases.requirement";
$columns{'author'} = "map_case_author.login_name";
$columns{'default_tester'} = "map_default_tester.login_name";
@@ -147,9 +147,9 @@ sub init {
$columns{'run_status'} = "test_runs.close_date";
$columns{'product'} = "map_run_product.name";
$columns{'build'} = "map_run_build.name";
$columns{'milestone'} = "map_run_milestone.value";
$columns{'milestone'} = "map_run_milestone.milestone";
$columns{'environment'} = "map_run_environment.name";
$columns{'tags'} = "map_run_tags.name";
$columns{'tags'} = "map_run_tags.tag_name";
$columns{'manager'} = "map_run_manager.login_name";
$columns{'default_product_version'} = "test_runs.product_version";
}
@@ -157,10 +157,27 @@ sub init {
$columns{'plan_type'} = "map_plan_type.name";
$columns{'product'} = "map_plan_product.name";
$columns{'archived'} = "test_plans.isactive";
$columns{'tags'} = "map_plan_tags.name";
$columns{'tags'} = "map_plan_tags.tag_name";
$columns{'author'} = "map_plan_author.login_name";
$columns{'default_product_version'} = "test_plans.default_product_version";
}
elsif ($type eq 'caserun'){
$columns{'build'} = "map_caserun_build.name";
$columns{'case'} = "map_caserun_case.summary";
$columns{'run'} = "map_caserun_run.summary";
$columns{'environment'} = "map_caserun_environment.name";
$columns{'assignee'} = "map_caserun_assignee.login_name";
$columns{'testedby'} = "map_caserun_testedby.login_name";
$columns{'status'} = "map_caserun_status.name";
$columns{'milestone'} = "map_caserun_milestone.milestone";
$columns{'case_tags'} = "map_caserun_case_tags.tag_name";
$columns{'run_tags'} = "map_caserun_run_tags.tag_name";
$columns{'requirement'} = "map_caserun_cases.requirement";
$columns{'priority'} = "map_caserun_priority.value";
$columns{'default_tester'} = "map_caserun_default_tester.login_name";
$columns{'category'} = "map_caserun_category.name";
$columns{'componnet'} = "map_caserun_components.name";
}
# One which means "nothing". Any number would do, really. It just gets SELECTed
# so that we always select 3 items in the query.
$columns{''} = "42217354";

View File

@@ -197,7 +197,7 @@ sub init {
}
if (grep(/map_run_milestone/, @$fields)) {
push @supptables, "INNER JOIN test_builds AS map_run_milestone " .
"ON test_runs.build_id = map_run_build.build_id";
"ON test_runs.build_id = map_run_milestone.build_id";
}
if (grep(/map_run_environment/, @$fields)) {
push @supptables, "INNER JOIN test_environments AS map_run_environment " .
@@ -233,6 +233,74 @@ sub init {
push @supptables, "INNER JOIN profiles AS map_plan_author " .
"ON test_plans.author_id = map_plan_author.userid";
}
## Case-runs ##
if (grep(/map_caserun_assignee/, @$fields)) {
push @supptables, "INNER JOIN profiles AS map_caserun_assignee " .
"ON test_case_runs.assignee = map_caserun_assignee.userid";
}
if (grep(/map_caserun_testedby/, @$fields)) {
push @supptables, "INNER JOIN profiles AS map_caserun_testedby " .
"ON test_case_runs.testedby = map_caserun_testedby.userid";
}
if (grep(/map_caserun_build/, @$fields)) {
push @supptables, "INNER JOIN test_builds AS map_caserun_build " .
"ON test_case_runs.build_id = map_caserun_build.build_id";
}
if (grep(/map_caserun_environment/, @$fields)) {
push @supptables, "INNER JOIN test_environments AS map_caserun_environment " .
"ON test_case_runs.environment_id = map_caserun_environment.environment_id";
}
if (grep(/map_caserun_status/, @$fields)) {
push @supptables, "INNER JOIN test_case_run_status AS map_caserun_status " .
"ON test_case_runs.case_run_status_id = map_caserun_status.case_run_status_id";
}
if (grep(/map_caserun_milestone/, @$fields)) {
push @supptables, "INNER JOIN test_builds AS map_caserun_milestone " .
"ON test_case_runs.build_id = map_caserun_milestone.build_id";
}
if (grep(/map_caserun_case_tags/, @$fields)) {
push @supptables, "INNER JOIN test_case_tags AS tctags " .
"ON test_case_runs.case_id = tctags.case_id";
push @supptables, "INNER JOIN test_tags AS map_caserun_case_tags " .
"ON tctags.tag_id = map_caserun_case_tags.tag_id";
}
if (grep(/map_caserun_run_tags/, @$fields)) {
push @supptables, "INNER JOIN test_run_tags " .
"ON test_case_runs.run_id = test_run_tags.run_id";
push @supptables, "INNER JOIN test_tags AS map_run_tags " .
"ON test_run_tags.tag_id = map_caserun_run_tags.tag_id";
}
if (grep(/map_caserun_cases/, @$fields)) {
push @supptables, "INNER JOIN test_cases AS map_caserun_cases " .
"ON test_case_runs.case_id = map_caserun_cases.case_id";
}
if (grep(/map_caserun_priority/, @$fields)) {
push @supptables, "INNER JOIN test_cases AS map_caserun_cases " .
"ON test_case_runs.case_id = map_caserun_cases.case_id";
push @supptables, "INNER JOIN priority AS map_caserun_priority " .
"ON map_caserun_cases.priority_id = map_caserun_priority.case_id";
}
if (grep(/map_caserun_default_tester/, @$fields)) {
push @supptables, "INNER JOIN test_cases AS map_caserun_cases " .
"ON test_case_runs.case_id = map_caserun_cases.case_id";
push @supptables, "INNER JOIN profiles AS map_caserun_default_tester " .
"ON map_caserun_cases.default_tester = map_caserun_default_tester.userid";
}
if (grep(/map_caserun_category/, @$fields)) {
push @supptables, "INNER JOIN test_cases AS map_caserun_cases " .
"ON test_case_runs.case_id = map_caserun_cases.case_id";
push @supptables, "INNER JOIN test_case_categories AS map_caserun_category " .
"ON map_caserun_cases.category_id = map_caserun_category.category_id";
}
if (grep(/map_caserun_components/, @$fields)) {
push @supptables, "INNER JOIN test_cases AS map_caserun_cases " .
"ON test_case_runs.case_id = map_caserun_cases.case_id";
push @supptables, "INNER JOIN test_cases AS map_caserun_cases " .
"ON map_caserun_cases.case_id = test_case_components.case_id";
push @supptables, "INNER JOIN components AS map_caserun_components " .
"ON map_caserun_cases.component_id = map_caserun_components.id";
}
}
# Set up tables for field sort order
@@ -529,6 +597,14 @@ sub init {
}
$f = "test_tags.tag_name";
},
"^requirement," => sub {
if ($obj eq 'case_run'){
push(@supptables,
"INNER JOIN test_cases " .
"ON test_case_runs.case_id = test_cases.case_id");
}
$f = "test_cases.requirement";
},
"^case_plan_id," => sub {
push(@supptables,
"INNER JOIN test_case_plans AS case_plans " .
@@ -568,6 +644,15 @@ sub init {
"ON case_runs.case_id = test_cases.case_id");
$f = "test_cases.case_id";
},
"^caserun_plan_id," => sub {
push(@supptables,
"INNER JOIN test_runs " .
"ON test_case_runs.run_id = test_runs.run_id");
push(@supptables,
"INNER JOIN test_plans " .
"ON test_runs.plan_id = test_plans.plan_id");
$f = "test_plans.plan_id";
},
"^case_prod," => sub {
push(@supptables,
"INNER JOIN test_case_plans AS case_plans " .
@@ -585,6 +670,24 @@ sub init {
$f = "products.name";
}
},
"^caserun_prod," => sub {
push(@supptables,
"INNER JOIN test_runs " .
"ON test_case_runs.run_id = test_runs.run_id");
push(@supptables,
"INNER JOIN test_plans " .
"ON test_runs.plan_id = test_plans.plan_id");
push(@supptables,
"INNER JOIN products " .
"ON test_plans.product_id = products.id");
if ($cgi->param('product_id')){
$f = "test_plans.product_id";
}
else {
$f = "products.name";
}
},
"^run_prod," => sub {
push(@supptables,
@@ -600,6 +703,20 @@ sub init {
$f = "products.name";
}
},
"^stop_date," => sub {
if ($obj eq 'case_run'){
push(@supptables,
"INNER JOIN test_runs " .
"ON test_case_runs.run_id = test_runs.run_id");
$f = "test_runs.stop_date";
}
},
"^run_product_version," => sub {
push(@supptables,
"INNER JOIN test_runs " .
"ON test_case_runs.run_id = test_runs.run_id");
$f = "test_runs.product_version";
},
"^(author|manager|default_tester)," => sub {
push(@supptables,
"INNER JOIN profiles AS map_$1 " .
@@ -763,6 +880,9 @@ sub init {
elsif ($obj eq 'run'){
push(@specialchart, ["run_plan_id", $type, join(',', $cgi->param('plan_id'))]);
}
elsif ($obj eq 'case_run'){
push(@specialchart, ["caserun_plan_id", $type, join(',', $cgi->param('plan_id'))]);
}
else{
push(@specialchart, ["plan_id", $type, join(',', $cgi->param('plan_id'))]);
}
@@ -786,6 +906,9 @@ sub init {
elsif ($obj eq 'case'){
push(@specialchart, ["case_prod", $type, join(',', $cgi->param($attribute))]);
}
elsif ($obj eq 'case_run'){
push(@specialchart, ["caserun_prod", $type, join(',', $cgi->param($attribute))]);
}
else{
if ($cgi->param("product")){
push(@specialchart, ["prod_name", $type, join(',', $cgi->param($attribute))]);
@@ -798,7 +921,7 @@ sub init {
# Check the Multi select fields and add them to the chart
my @legal_fields = ("case_status_id", "category", "category_id", "priority_id",
"component", "isautomated", "case_run_status_id",
"default_product_version", "type_id",
"default_product_version", "run_product_version", "type_id",
"build", "build_id", "environment_id", "milestone", "env_products",
"env_categories", "env_elements", "env_properties",
"env_expressions", "case_status", "priority", "environment",

View File

@@ -135,9 +135,9 @@ sub report_columns {
$columns{'Requirement'} = "requirement";
$columns{'Author'} = "author";
$columns{'Default tester'} = "default_tester";
$columns{'<none>'} = '';
my @result;
push @result, {'name' => $_, 'id' => $columns{$_}} foreach (keys %columns);
push @result, {'name' => $_, 'id' => $columns{$_}} foreach (sort(keys %columns));
unshift @result, {'name' => '<none>', 'id'=> ''};
return \@result;
}

View File

@@ -91,6 +91,29 @@ use constant DB_COLUMNS => qw(
our $columns = join(", ", DB_COLUMNS);
sub report_columns {
my $self = shift;
my %columns;
# Changes here need to match Report.pm
$columns{'Build'} = "build";
$columns{'Status'} = "status";
$columns{'Environment'} = "environment";
$columns{'Assignee'} = "assignee";
$columns{'Tested By'} = "testedby";
$columns{'Milestone'} = "milestone";
$columns{'Case Tags'} = "case_tags";
$columns{'Run Tags'} = "run_tags";
$columns{'Requirement'} = "requirement";
$columns{'Priority'} = "priority";
$columns{'Default tester'} = "default_tester";
$columns{'Category'} = "category";
$columns{'Component'} = "component";
my @result;
push @result, {'name' => $_, 'id' => $columns{$_}} foreach (sort(keys %columns));
unshift @result, {'name' => '<none>', 'id'=> ''};
return \@result;
}
###############################
#### Methods ####
@@ -677,6 +700,18 @@ sub sortkey { return $_[0]->{'sortkey'}; }
sub isprivate { return $_[0]->{'isprivate'}; }
sub updated_deps { return $_[0]->{'updated_deps'}; }
=head2 type
Returns 'case'
=cut
sub type {
my $self = shift;
$self->{'type'} = 'caserun';
return $self->{'type'};
}
=head2 notes
Returns the cumulative notes of all caserun records of this case and run.

View File

@@ -97,9 +97,9 @@ sub report_columns {
$columns{'Archived'} = "archived";
$columns{'Tags'} = "tags";
$columns{'Author'} = "author";
$columns{'<none>'} = '';
my @result;
push @result, {'name' => $_, 'id' => $columns{$_}} foreach (keys %columns);
push @result, {'name' => $_, 'id' => $columns{$_}} foreach (sort(keys %columns));
unshift @result, {'name' => '<none>', 'id'=> ''};
return \@result;
}
@@ -450,6 +450,30 @@ sub get_product_components {
return $ref;
}
=head2 get_product_environments
Returns al list of environments for the given product. If one
is not specified, use the plan product.
=cut
sub get_product_environments {
#TODO: 2.22 use product.pm
my $self = shift;
my ($product_id) = @_;
$product_id ||= $self->{'product_id'};
my $dbh = Bugzilla->dbh;
my $ref = $dbh->selectall_arrayref(
"SELECT DISTINCT name AS id, name
FROM test_environments
WHERE product_id IN($product_id)
ORDER BY name",
{'Slice'=>{}});
return $ref;
}
=head2 get_case_ids_by_category
Returns a list of case_ids in this plan from the selected categories.
@@ -917,6 +941,18 @@ sub name { return $_[0]->{'name'}; }
sub type_id { return $_[0]->{'type_id'}; }
sub isactive { return $_[0]->{'isactive'}; }
=head2 type
Returns 'case'
=cut
sub type {
my $self = shift;
$self->{'type'} = 'plan';
return $self->{'type'};
}
=head2 attachments
Returns a reference to a list of attachments on this plan

View File

@@ -100,9 +100,9 @@ sub report_columns {
$columns{'Environment'} = "environment";
$columns{'Tags'} = "tags";
$columns{'Manager'} = "manager";
$columns{'<none>'} = '';
my @result;
push @result, {'name' => $_, 'id' => $columns{$_}} foreach (keys %columns);
push @result, {'name' => $_, 'id' => $columns{$_}} foreach (sort(keys %columns));
unshift @result, {'name' => '<none>', 'id'=> ''};
return \@result;
}
@@ -811,6 +811,18 @@ sub summary { return $_[0]->{'summary'}; }
sub notes { return $_[0]->{'notes'}; }
sub product_version { return $_[0]->{'product_version'}; }
=head2 type
Returns 'case'
=cut
sub type {
my $self = shift;
$self->{'type'} = 'run';
return $self->{'type'};
}
=head2 plan
Returns the Testopia::TestPlan object of the plan this run

View File

@@ -1,11 +1,23 @@
<form method="GET" action="[% table.url_loc FILTER none %]">
<form method="GET" action="[% table.url_loc FILTER none %]" id="filter_form">
<input type="hidden" name="run_id" value="[% run.id FILTER none %]" />
[% query = table.get_query_part %]
<div class="bz_row_header" style="font-size:12pt; font-weight: bold;">
<img src="[% query.match('assignee') ? 'testopia/img/td.gif' : 'testopia/img/tr.gif' %]" id="ft" onclick="_sr(document.getElementById('filter'),document.getElementById('ft'))">
<img src="[% query.match('assignee') AND NOT hide_filter ? 'testopia/img/td.gif' : 'testopia/img/tr.gif' %]" id="cft" onclick="_sr(document.getElementById('caserun_report'),document.getElementById('cft'))">
<a href="javascript:_sr(document.getElementById('caserun_report'),document.getElementById('cft'))" style="text-decoration:none;">Reports</a>
</div>
<div id="caserun_report" [% query.match('assignee') AND NOT hide_filter ? 'style="display:block"' : 'style="display:none"' %]>
[% PROCESS "testopia/search/report-matrix.html.tmpl"
obj = table.list.0
%]
<p align="right">
<input type="button" value="Report" onclick="document.getElementById('filter_form').action='tr_caserun_reports.cgi';document.getElementById('filter_form').submit();">
</p>
</div>
<div class="bz_row_header" style="font-size:12pt; font-weight: bold;">
<img src="[% query.match('assignee') AND NOT hide_filter ? 'testopia/img/td.gif' : 'testopia/img/tr.gif' %]" id="ft" onclick="_sr(document.getElementById('filter'),document.getElementById('ft'))">
<a href="javascript:_sr(document.getElementById('filter'),document.getElementById('ft'))" style="text-decoration:none;">Filter</a>
</div>
<div id="filter" [% query.match('assignee')? 'style="display:block"' : 'style="display:none"' %]>
<div id="filter" [% query.match('assignee') AND NOT hide_filter ? 'style="display:block"' : 'style="display:none"' %]>
<table>
<tr class="bz_row_header">
<th>Status</th>
@@ -34,6 +46,12 @@
<input name="case_summary">
</td>
</tr>
<tr>
<th align="right">Requirement</th>
<td><input type="hidden" name="requirement_type" value="substring" />
<input name="requirement">
</td>
</tr>
<tr>
<th align="right">Environment</th>
<td><input type="hidden" name="environment_type" value="anyexact" />
@@ -52,7 +70,7 @@
<tr>
<td valign="top">
[% PROCESS select sel = { name => "case_run_status_id",
list => run.current_caseruns.0.get_status_list,
list => table.list.0.get_status_list,
elements => 6,
mult => 1, }
%]
@@ -76,7 +94,7 @@
</td>
<td valign="top">
[% PROCESS select sel = { name => "priority_id",
list => run.current_caseruns.0.case.get_priority_list,
list => table.list.0.case.get_priority_list,
elements => 6,
mult => 1, }
%]

View File

@@ -42,9 +42,9 @@
[% PROCESS testopia/messages.html.tmpl %]
<script src="testopia/js/util.js" type="text/javascript"></script>
[% IF table.list_count %]
[% PROCESS "testopia/caserun/filter.html.tmpl" %]
[% END %]
<form id="table" action="tr_list_caseruns.cgi" method="POST">
<br/>
[% IF table.list_count %]

View File

@@ -38,11 +38,11 @@
[% PROCESS testopia/style.none.tmpl %]
<table border="1">
<table border="0">
<tr>
<td>&nbsp;&nbsp;&nbsp;&nbsp;Build<br>Case</td>
<td>&nbsp;</td>
[% FOREACH b = report.builds %]
<td>[% b.value %]</td>
<td><img src=tr_draw.cgi?text=[% b.value %]"/></td>
[% END %]
</tr>
[% FOREACH case = report.keys %]

View File

@@ -41,6 +41,7 @@
[% tabs = [ { name => 'case', description => "Find Test Cases" },
{ name => 'run', description => "Find Test Runs" },
{ name => 'plan', description => "Find Test Plans" },
{ name => 'case_run', description => "Find Test Case-Runs" },
{ name => 'environment', description => "Find Test Run Environments" }, ] %]
<script src="testopia/dojo/dojo.js" type="text/javascript"></script>
@@ -65,8 +66,12 @@
if (tab == 'run'){
var milestones = xmldocroot.getElementsByTagName('milestone');
var builds = xmldocroot.getElementsByTagName('build');
var environment = xmldocroot.getElementsByTagName('environment');
var selMilestone = document.getElementById("milestone");
var selBuild = document.getElementById("build");
var selEnv = document.getElementById("environment");
selBuild.options.length = 0;
selMilestone.options.length = 0;
for (i=0; i< milestones.length; i++){
@@ -81,7 +86,63 @@
var myOp = new Option(name, id);
addOption(selBuild,myOp);
}
for (i=0; i< environment.length; i++){
var id = environment[i].firstChild.nodeValue;
var name = environment[i].firstChild.nodeValue;
var myOp = new Option(name, id);
addOption(selEnv,myOp);
}
}
if (tab == 'case_run'){
var milestones = xmldocroot.getElementsByTagName('milestone');
var builds = xmldocroot.getElementsByTagName('build');
var components = xmldocroot.getElementsByTagName('component');
var categories = xmldocroot.getElementsByTagName('category');
var environment = xmldocroot.getElementsByTagName('environment');
var selMilestone = document.getElementById("milestone");
var selBuild = document.getElementById("build");
var selComponent = document.getElementById("component");
var selCategory = document.getElementById("category");
var selEnv = document.getElementById("environment");
selComponent.options.length = 0;
selCategory.options.length = 0;
selBuild.options.length = 0;
selMilestone.options.length = 0;
for (i=0; i< milestones.length; i++){
var id = milestones[i].firstChild.nodeValue;
var name = milestones[i].firstChild.nodeValue;
var myOp = new Option(name, id);
addOption(selMilestone,myOp);
}
for (i=0; i< builds.length; i++){
var id = builds[i].firstChild.nodeValue;
var name = builds[i].firstChild.nodeValue;
var myOp = new Option(name, id);
addOption(selBuild,myOp);
}
for (i=0; i< components.length; i++){
var id = components[i].firstChild.nodeValue;
var name = components[i].firstChild.nodeValue;
var myOp = new Option(name, id);
addOption(selComponent,myOp);
}
for (i=0; i< categories.length; i++){
var id = categories[i].firstChild.nodeValue;
var name = categories[i].firstChild.nodeValue;
var myOp = new Option(name, id);
addOption(selCategory,myOp);
}
for (i=0; i< environment.length; i++){
var id = environment[i].firstChild.nodeValue;
var name = environment[i].firstChild.nodeValue;
var myOp = new Option(name, id);
addOption(selEnv,myOp);
}
}
if (tab == 'case' || tab == ''){
var components = xmldocroot.getElementsByTagName('component');
@@ -150,6 +211,8 @@
[% PROCESS testopia/search/plan.html.tmpl %]
[% ELSIF current_tab == 'run' %]
[% PROCESS testopia/search/run.html.tmpl %]
[% ELSIF current_tab == 'case_run' %]
[% PROCESS testopia/search/caserun.html.tmpl %]
[% ELSIF current_tab == 'environment' %]
[% PROCESS testopia/search/environment.html.tmpl %]
[% ELSE %]

View File

@@ -20,55 +20,10 @@
[% IF report %]
<form action="tr_case_reports.cgi" method="GET">
<p>
Choose one or more fields as your axes, and then refine your set of
cases using the rest of the form.
</p>
<table align="center">
<tr>
<td>
</td>
<td align="center">
<b>Horizontal Axis:</b>
[% PROCESS select sel = { name => 'x_axis_field',
list => case.report_columns } %]
</td>
</tr>
<tr>
<td valign="middle" align="center">
<b>Vertical Axis:</b><br>
[% PROCESS select sel = { name => 'y_axis_field',
list => case.report_columns } %]
</td>
<td width="150" height="150">
<table border="1" width="100%" height="100%">
<tr>
<td align="center" valign="middle">
<b>Multiple Tables:</b><br>
[% PROCESS select sel = { name => 'z_axis_field',
list => case.report_columns } %]
</td>
</tr>
</table>
</td>
</tr>
</table>
<hr>
<br>
<input type="submit" value="Submit">
<input type="hidden" name="format" value="table">
<input type="hidden" name="report_action" value="data">
<input type="hidden" name="report" value="1" />
<hr>
<form action="tr_case_reports.cgi" method="GET">
[% PROCESS "testopia/search/report-matrix.html.tmpl"
obj = case
%]
[% ELSE %]
<form action="tr_list_cases.cgi" method="GET">
[% END %]

View File

@@ -0,0 +1,229 @@
[%# 1.0@bugzilla.org %]
[%# The contents of this file are subject to the Mozilla Public
# License Version 1.1 (the "License"); you may not use this file
# except in compliance with the License. You may obtain a copy of
# the License at http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
# implied. See the License for the specific language governing
# rights and limitations under the License.
#
# The Original Code is the Bugzilla Test Runner System.
#
# The Initial Developer of the Original Code is Maciej Maczynski.
# Portions created by Maciej Maczynski are Copyright (C) 2001
# Maciej Maczynski. All Rights Reserved.
#
# Contributor(s): Greg Hendricks <ghendricks@novell.com>
#%]
[% IF report %]
<form action="tr_caserun_reports.cgi" method="GET">
[% PROCESS "testopia/search/report-matrix.html.tmpl"
obj = caserun
%]
[% ELSE %]
<form action="tr_list_caseruns.cgi" method="GET">
[% END %]
<input type="hidden" name="current_tab" value="[% current_tab FILTER none %]" />
<input type="hidden" name="hide_filter" value="1" />
<fieldset>
<legend><strong>Product</strong></legend>
<table>
<tr class="bz_row_header">
<th>Status</th>
<th>Product</th>
<th>Components</th>
<th>Category</th>
<th>Priority</th>
<th>Automatic</th>
</tr>
<tr>
<td style="padding-right: 30px;">
[% PROCESS select sel = { name => "case_run_status_id",
list => caserun.get_status_list,
elements => 6,
mult => 1, }
%]
</td>
<td style="padding-right: 30px;">
[% PROCESS select sel = { name => 'product_id',
accesskey => 'p',
list => plan.get_available_products,
elements => 5,
mult => 1
events => 'onChange="onProductSelection()"' } %]
</td>
<td style="padding-right: 30px;">
[% PROCESS select sel = { name => 'component',
accesskey => 'm',
list => case.get_available_components
elements => 5,
mult => 1 } %]
</td>
<td style="padding-right: 30px;">
[% PROCESS select sel = { name => 'category',
accesskey => 't',
list => case.get_category_list(1),
elements => 5,
mult => 1 } %]
</td>
<td style="padding-right: 30px;">
[% PROCESS select sel = { name => 'priority_id',
accesskey => 'p',
list => case.get_priority_list
elements => 5,
mult => 1 } %]
</td>
<td style="padding-right: 30px;">
[% PROCESS select sel = { name => 'isautomated',
accesskey => 'a',
list =>
[ { id => "0", name => "Manual" },
{ id => "1", name => "Automatic" } ]
elements => 5,
mult => 1 } %]
</td>
</tr>
<tr class="bz_row_header">
<th>Run Status</th>
<th>Version</th>
<th>Build</th>
<th>Milestone</th>
<th>Environment</th>
</tr>
<tr>
<td style="padding-right: 30px;">
[% PROCESS select sel = { name => 'run_status',
accesskey => 's',
list => run.get_status_list
elements => 5,
mult => 1 } %]
</td>
<td style="padding-right: 30px;">
[% PROCESS select sel = { name => 'run_product_version',
accesskey => 'v',
list => product_versions,
elements => 5,
mult => 1 } %]
</td>
<td style="padding-right: 30px;">
[% PROCESS select sel = { name => 'build',
accesskey => 't',
list => run.get_distinct_builds,
elements => 5,
mult => 1 } %]
</td>
<td style="padding-right: 30px;">
[% PROCESS select sel = { name => 'milestone',
accesskey => 'm',
list => run.get_distinct_milestones,
elements => 5,
mult => 1 } %]
</td>
<td style="padding-right: 30px;">
[% PROCESS select sel = { name => 'environment',
accesskey => 'e',
list => run.get_environments,
elements => 5,
mult => 1 } %]
</td>
</tr>
</table>
</fieldset>
<fieldset>
<legend><strong>Attributes</strong></legend>
<table>
<tr>
<th align="right">Assignee</th>
<td>
[% PROCESS select sel = { name => 'assignee_type',
list => email_variants } %]</td>
<td>
<input name="assignee">
</td>
<th><input type="radio" name="andor" value="1"/>AND
<input type="radio" name="andor" value="0" checked="checked"/>OR</th>
</tr>
<tr>
<th align="right">Tested By</th>
<td>
[% PROCESS select sel = { name => 'testedby_type',
list => email_variants } %]</td>
<td>
<input name="testedby">
</td>
</tr>
<tr>
<th align="right">Case Summary</th>
<td>
[% PROCESS select sel = { name => 'case_summary_type',
list => query_variants } %]</td>
<td>
<input name="case_summary">
</td>
</tr>
<tr>
<th align="right">Requirement</th>
<td>
[% PROCESS select sel = { name => 'requirement_type',
list => query_variants } %]</td>
<td>
<input name="requirement">
</td>
</tr>
<tr>
<th align="right">Environment</th>
<td>
[% PROCESS select sel = { name => 'environment_type',
list => query_variants } %]</td>
<td>
<input name="environment">
</td>
</tr>
<tr>
<th align="right">Case Tags</th>
<td>
[% PROCESS select sel = { name => 'tags_type',
list => tag_variants } %]</td>
<td>
<input name="tags">
</td>
</tr>
<tr>
<th align="right">Notes</th>
<td>
[% PROCESS select sel = { name => 'notes_type',
list => query_variants } %]</td>
<td>
<input name="notes">
</td>
</tr>
</table>
</fieldset>
<p style="font-weight: bold;">
<label for="case_id">
Include case-runs from cases numbered:
</label>
<input name="case_id" id="case_id">
<br/><br/>
<label for="plan_id">
Include case-runs from plans numbered:
</label>
<input name="plan_id" id="plan_id">
<br/><br/>
<label for="run_id">
Include case-runs in runs numbered:
</label>
<input name="run_id" id="run_id">
<br/><br/>
</p>
<input type="submit" value="Submit">
</form>

View File

@@ -20,54 +20,9 @@
[% IF report %]
<form action="tr_plan_reports.cgi" method="GET">
<p>
Choose one or more fields as your axes, and then refine your set of
plans using the rest of the form.
</p>
<table align="center">
<tr>
<td>
</td>
<td align="center">
<b>Horizontal Axis:</b>
[% PROCESS select sel = { name => 'x_axis_field',
list => plan.report_columns } %]
</td>
</tr>
<tr>
<td valign="middle" align="center">
<b>Vertical Axis:</b><br>
[% PROCESS select sel = { name => 'y_axis_field',
list => plan.report_columns } %]
</td>
<td width="150" height="150">
<table border="1" width="100%" height="100%">
<tr>
<td align="center" valign="middle">
<b>Multiple Tables:</b><br>
[% PROCESS select sel = { name => 'z_axis_field',
list => plan.report_columns } %]
</td>
</tr>
</table>
</td>
</tr>
</table>
<hr>
<br>
<input type="submit" value="Submit">
<input type="hidden" name="format" value="table">
<input type="hidden" name="report_action" value="data">
<input type="hidden" name="report" value="1" />
<hr>
[% PROCESS "testopia/search/report-matrix.html.tmpl"
obj = plan
%]
[% ELSE %]
<form action="tr_list_plans.cgi" method="GET">
[% END %]

View File

@@ -0,0 +1,64 @@
[%# 1.0@bugzilla.org %]
[%# The contents of this file are subject to the Mozilla Public
# License Version 1.1 (the "License"); you may not use this file
# except in compliance with the License. You may obtain a copy of
# the License at http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
# implied. See the License for the specific language governing
# rights and limitations under the License.
#
# The Original Code is the Bugzilla Test Runner System.
#
# The Initial Developer of the Original Code is Maciej Maczynski.
# Portions created by Maciej Maczynski are Copyright (C) 2001
# Maciej Maczynski. All Rights Reserved.
#
# Contributor(s): Greg Hendricks <ghendricks@novell.com>
#%]
<p>
Choose one or more fields as your axes, and then refine your set of
[% obj.type FILTER none %]s using the rest of the form.
</p>
<table align="center">
<tr>
<td>
</td>
<td align="center">
<b>Horizontal Axis:</b>
[% PROCESS select sel = { name => 'x_axis_field',
list => obj.report_columns } %]
</td>
</tr>
<tr>
<td valign="middle" align="center">
<b>Vertical Axis:</b><br>
[% PROCESS select sel = { name => 'y_axis_field',
list => obj.report_columns } %]
</td>
<td width="150" height="150">
<table border="1" width="100%" height="100%">
<tr>
<td align="center" valign="middle">
<b>Multiple Tables:</b><br>
[% PROCESS select sel = { name => 'z_axis_field',
list => obj.report_columns } %]
</td>
</tr>
</table>
</td>
</tr>
</table>
<br>
<input type="hidden" name="format" value="table">
<input type="hidden" name="report_action" value="data">
<input type="hidden" name="report" value="1" />

View File

@@ -20,54 +20,9 @@
[% IF report %]
<form action="tr_run_reports.cgi" method="GET">
<p>
Choose one or more fields as your axes, and then refine your set of
runs using the rest of the form.
</p>
<table align="center">
<tr>
<td>
</td>
<td align="center">
<b>Horizontal Axis:</b>
[% PROCESS select sel = { name => 'x_axis_field',
list => run.report_columns } %]
</td>
</tr>
<tr>
<td valign="middle" align="center">
<b>Vertical Axis:</b><br>
[% PROCESS select sel = { name => 'y_axis_field',
list => run.report_columns } %]
</td>
<td width="150" height="150">
<table border="1" width="100%" height="100%">
<tr>
<td align="center" valign="middle">
<b>Multiple Tables:</b><br>
[% PROCESS select sel = { name => 'z_axis_field',
list => run.report_columns } %]
</td>
</tr>
</table>
</td>
</tr>
</table>
<hr>
<br>
<input type="submit" value="Submit">
<input type="hidden" name="format" value="table">
<input type="hidden" name="report_action" value="data">
<input type="hidden" name="report" value="1" />
<hr>
[% PROCESS "testopia/search/report-matrix.html.tmpl"
obj = run
%]
[% ELSE %]
<form action="tr_list_runs.cgi" method="GET">
[% END %]

View File

@@ -0,0 +1,17 @@
[% FILTER null;
USE gd = GD.Image(200,40);
USE gdc = GD.Constants;
white = gd.colorAllocate(255,255, 255);
black = gd.colorAllocate(0,0,0);
USE wrapbox = GD.Text.Wrap(gd,
line_space => 4,
color => black,
text => txt,
);
wrapbox.set_font(gdc.gdMediumBoldFont);
wrapbox.set(align => 'left', width => 200);
wrapbox.draw(2, 2);
gdr = gd.copyRotate270();
gdr.png | stdout(1);
END;
-%]

View File

@@ -0,0 +1,88 @@
#!/usr/bin/perl -wT
# -*- Mode: perl; indent-tabs-mode: nil -*-
#
# The contents of this file are subject to the Mozilla Public
# License Version 1.1 (the "License"); you may not use this file
# except in compliance with the License. You may obtain a copy of
# the License at http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
# implied. See the License for the specific language governing
# rights and limitations under the License.
#
# The Original Code is the Bugzilla Test Runner System.
#
# The Initial Developer of the Original Code is Maciej Maczynski.
# Portions created by Maciej Maczynski are Copyright (C) 2001
# Maciej Maczynski. All Rights Reserved.
#
# Contributor(s): Maciej Maczynski <macmac@xdsnet.pl>
# Ed Fuentetaja <efuentetaja@acm.org>
# Greg Hendricks <ghendricks@novell.com>
use strict;
use lib ".";
use Bugzilla;
use Bugzilla::Constants;
use Bugzilla::Error;
use Bugzilla::Util;
use Bugzilla::Testopia::Util;
use Bugzilla::Testopia::Constants;
use Bugzilla::Testopia::Report;
use vars qw($template $vars);
my $template = Bugzilla->template;
my $cgi = Bugzilla->cgi;
Bugzilla->login();
my $type = $cgi->param('type') || '';
if ($type eq 'status-breakdown'){
}
else{
$cgi->param('current_tab', 'case_run');
$cgi->param('viewall', 1);
my $report = Bugzilla::Testopia::Report->new('caserun', 'tr_list_caseruns.cgi', $cgi);
$vars->{'report'} = $report;
### From Bugzilla report.cgi by Gervase Markham
my $formatparam = $cgi->param('format');
my $report_action = $cgi->param('report_action');
if ($report_action eq "data") {
# So which template are we using? If action is "wrap", we will be using
# no format (it gets passed through to be the format of the actual data),
# and either report.csv.tmpl (CSV), or report.html.tmpl (everything else).
# report.html.tmpl produces an HTML framework for either tables of HTML
# data, or images generated by calling report.cgi again with action as
# "plot".
$formatparam =~ s/[^a-zA-Z\-]//g;
trick_taint($formatparam);
$vars->{'format'} = $formatparam;
$formatparam = '';
}
elsif ($report_action eq "plot") {
# If action is "plot", we will be using a format as normal (pie, bar etc.)
# and a ctype as normal (currently only png.)
$vars->{'cumulate'} = $cgi->param('cumulate') ? 1 : 0;
$vars->{'x_labels_vertical'} = $cgi->param('x_labels_vertical') ? 1 : 0;
$vars->{'data'} = $report->{'image_data'};
}
else {
ThrowCodeError("unknown_action", {action => $cgi->param('report_action')});
}
my $format = $template->get_format("testopia/reports/report", $formatparam,
scalar($cgi->param('ctype')));
my $filename = "report-" . $report->{'date'} . ".$format->{extension}";
print $cgi->header(-type => $format->{'ctype'},
-content_disposition => "inline; filename=$filename");
$template->process("$format->{'template'}", $vars)
|| ThrowTemplateError($template->error());
exit;
}

View File

@@ -0,0 +1,44 @@
#!/usr/bin/perl -wT
# -*- Mode: perl; indent-tabs-mode: nil -*-
#
# The contents of this file are subject to the Mozilla Public
# License Version 1.1 (the "License"); you may not use this file
# except in compliance with the License. You may obtain a copy of
# the License at http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
# implied. See the License for the specific language governing
# rights and limitations under the License.
#
# The Original Code is the Bugzilla Test Runner System.
#
# The Initial Developer of the Original Code is Maciej Maczynski.
# Portions created by Maciej Maczynski are Copyright (C) 2001
# Maciej Maczynski. All Rights Reserved.
#
# Contributor(s): Greg Hendricks <ghendricks@novell.com>
use strict;
use lib ".";
use Bugzilla;
use Bugzilla::Util;
use Bugzilla::Constants;
use Bugzilla::Error;
use Bugzilla::Config;
use Bugzilla::Testopia::TestPlan;
use Bugzilla::Testopia::Build;
use Bugzilla::Testopia::Search;
use Bugzilla::Testopia::Table;
use Bugzilla::Testopia::Util;
Bugzilla->login(LOGIN_REQUIRED);
use vars qw($vars);
my $template = Bugzilla->template;
my $cgi = Bugzilla->cgi;
print $cgi->header;
$vars->{'txt'} = $cgi->param('text');
$template->process("testopia/text.png.tmpl", $vars)
|| ThrowTemplateError($template->error());

View File

@@ -253,6 +253,7 @@ my $case = Bugzilla::Testopia::TestCase->new({'case_id' => 0});
$vars->{'component_list'} = $case->get_available_components();
$vars->{'dotweak'} = UserInGroup('edittestcases');
$vars->{'table'} = $table;
$vars->{'hide_filter'} = $cgi->param('hide_filter');
$vars->{'action'} = 'tr_list_caserun.cgi';
if ($serverpush && !$cgi->param('debug')) {
print $cgi->multipart_end;

View File

@@ -59,11 +59,17 @@ if ($type eq 'build_coverage'){
$report->{$case->id}->{$cr->build->id} = $cr;
}
}
$report->{'builds'} = \%buildseen;
$vars->{'report'} = $report;
$vars->{'plan'} = $plan;
print $cgi->header();
if ($cgi->param('debug')){
use Data::Dumper;
print Dumper(\%buildseen);
print Dumper($report);
}
$template->process("testopia/reports/build-coverage.html.tmpl", $vars)
|| ThrowTemplateError($template->error());

View File

@@ -59,11 +59,12 @@ if ($action eq 'getversions'){
push @validated, $p if can_view_product($p);
}
my $prodlist = join(",", @validated);
my $versions = $plan->get_product_versions($prodlist) if ($tab eq 'run' || $tab eq 'plan');
my $milestones = $plan->get_product_milestones($prodlist) if ($tab eq 'run');
my $builds = $plan->get_product_builds($prodlist) if ($tab eq 'run');
my $components = $plan->get_product_components($prodlist) if ($tab eq 'case' || '');
my $categories = $plan->get_product_categories($prodlist) if ($tab eq 'case' || '');
my $versions = $plan->get_product_versions($prodlist) if ($tab eq 'run' || $tab eq 'plan' || $tab eq 'case_run');
my $milestones = $plan->get_product_milestones($prodlist) if ($tab eq 'run' || $tab eq 'case_run');
my $builds = $plan->get_product_builds($prodlist) if ($tab eq 'run' || $tab eq 'case_run');
my $components = $plan->get_product_components($prodlist) if ($tab eq 'case' || '' || $tab eq 'case_run');
my $categories = $plan->get_product_categories($prodlist) if ($tab eq 'case' || '' || $tab eq 'case_run');
my $environments = $plan->get_product_environments($prodlist) if ($tab eq 'case' || '' || $tab eq 'case_run');
my $ret = "<product>";
foreach my $value (@$versions){
@@ -81,6 +82,9 @@ if ($action eq 'getversions'){
foreach my $value (@$categories){
$ret .= "<category>". xml_quote($value->{'name'}) ."</category>";
}
foreach my $value (@$environments){
$ret .= "<environment>". xml_quote($value->{'name'}) ."</environment>";
}
$ret .= "</product>";
print $ret;
@@ -215,6 +219,12 @@ else{
$vars->{'env'} = Bugzilla::Testopia::Environment->new({'environment_id' => 0 });
$vars->{'title'} = "Search For Test Run Environments";
}
elsif ($tab eq 'case_run'){
$vars->{'case'} = Bugzilla::Testopia::TestCase->new({});
$vars->{'run'} = Bugzilla::Testopia::TestRun->new({});
$vars->{'caserun'} = Bugzilla::Testopia::TestCaseRun->new({});
$vars->{'title'} = "Search For Test Cases";
}
else { # show the case form
$tab = 'case';
my $case = Bugzilla::Testopia::TestCase->new({ 'case_id' => 0 });