diff --git a/mozilla/webtools/testopia/Bugzilla/Testopia/Report.pm b/mozilla/webtools/testopia/Bugzilla/Testopia/Report.pm index 9959b55adfe..e98ef507859 100644 --- a/mozilla/webtools/testopia/Bugzilla/Testopia/Report.pm +++ b/mozilla/webtools/testopia/Bugzilla/Testopia/Report.pm @@ -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"; diff --git a/mozilla/webtools/testopia/Bugzilla/Testopia/Search.pm b/mozilla/webtools/testopia/Bugzilla/Testopia/Search.pm index 1b65c95f3a8..467c77a3333 100644 --- a/mozilla/webtools/testopia/Bugzilla/Testopia/Search.pm +++ b/mozilla/webtools/testopia/Bugzilla/Testopia/Search.pm @@ -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", diff --git a/mozilla/webtools/testopia/Bugzilla/Testopia/TestCase.pm b/mozilla/webtools/testopia/Bugzilla/Testopia/TestCase.pm index e8c5b65d7a9..96e6543c889 100644 --- a/mozilla/webtools/testopia/Bugzilla/Testopia/TestCase.pm +++ b/mozilla/webtools/testopia/Bugzilla/Testopia/TestCase.pm @@ -135,9 +135,9 @@ sub report_columns { $columns{'Requirement'} = "requirement"; $columns{'Author'} = "author"; $columns{'Default tester'} = "default_tester"; - $columns{''} = ''; my @result; - push @result, {'name' => $_, 'id' => $columns{$_}} foreach (keys %columns); + push @result, {'name' => $_, 'id' => $columns{$_}} foreach (sort(keys %columns)); + unshift @result, {'name' => '', 'id'=> ''}; return \@result; } diff --git a/mozilla/webtools/testopia/Bugzilla/Testopia/TestCaseRun.pm b/mozilla/webtools/testopia/Bugzilla/Testopia/TestCaseRun.pm index dd74ab9aecd..ae803fa087b 100644 --- a/mozilla/webtools/testopia/Bugzilla/Testopia/TestCaseRun.pm +++ b/mozilla/webtools/testopia/Bugzilla/Testopia/TestCaseRun.pm @@ -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' => '', '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. diff --git a/mozilla/webtools/testopia/Bugzilla/Testopia/TestPlan.pm b/mozilla/webtools/testopia/Bugzilla/Testopia/TestPlan.pm index 9e67666645d..31e3957b740 100644 --- a/mozilla/webtools/testopia/Bugzilla/Testopia/TestPlan.pm +++ b/mozilla/webtools/testopia/Bugzilla/Testopia/TestPlan.pm @@ -97,9 +97,9 @@ sub report_columns { $columns{'Archived'} = "archived"; $columns{'Tags'} = "tags"; $columns{'Author'} = "author"; - $columns{''} = ''; my @result; - push @result, {'name' => $_, 'id' => $columns{$_}} foreach (keys %columns); + push @result, {'name' => $_, 'id' => $columns{$_}} foreach (sort(keys %columns)); + unshift @result, {'name' => '', '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 diff --git a/mozilla/webtools/testopia/Bugzilla/Testopia/TestRun.pm b/mozilla/webtools/testopia/Bugzilla/Testopia/TestRun.pm index e17aef69417..29fa2e09cc0 100644 --- a/mozilla/webtools/testopia/Bugzilla/Testopia/TestRun.pm +++ b/mozilla/webtools/testopia/Bugzilla/Testopia/TestRun.pm @@ -100,9 +100,9 @@ sub report_columns { $columns{'Environment'} = "environment"; $columns{'Tags'} = "tags"; $columns{'Manager'} = "manager"; - $columns{''} = ''; my @result; - push @result, {'name' => $_, 'id' => $columns{$_}} foreach (keys %columns); + push @result, {'name' => $_, 'id' => $columns{$_}} foreach (sort(keys %columns)); + unshift @result, {'name' => '', '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 diff --git a/mozilla/webtools/testopia/template/en/default/testopia/caserun/filter.html.tmpl b/mozilla/webtools/testopia/template/en/default/testopia/caserun/filter.html.tmpl index 97009bbca73..899f8064514 100644 --- a/mozilla/webtools/testopia/template/en/default/testopia/caserun/filter.html.tmpl +++ b/mozilla/webtools/testopia/template/en/default/testopia/caserun/filter.html.tmpl @@ -1,11 +1,23 @@ -
+ [% query = table.get_query_part %]
- + + Reports +
+
+[% PROCESS "testopia/search/report-matrix.html.tmpl" + obj = table.list.0 +%] +

+ +

+
+
+ Filter
-
+
@@ -34,6 +46,12 @@ + + + +
Status
Requirement + +
Environment @@ -52,7 +70,7 @@
[% 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 @@ [% 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, } %] diff --git a/mozilla/webtools/testopia/template/en/default/testopia/caserun/list.html.tmpl b/mozilla/webtools/testopia/template/en/default/testopia/caserun/list.html.tmpl index 60e88c0e23e..47f6ef463a5 100644 --- a/mozilla/webtools/testopia/template/en/default/testopia/caserun/list.html.tmpl +++ b/mozilla/webtools/testopia/template/en/default/testopia/caserun/list.html.tmpl @@ -42,9 +42,9 @@ [% PROCESS testopia/messages.html.tmpl %] - +[% IF table.list_count %] [% PROCESS "testopia/caserun/filter.html.tmpl" %] - +[% END %]
[% IF table.list_count %] diff --git a/mozilla/webtools/testopia/template/en/default/testopia/reports/build-coverage.html.tmpl b/mozilla/webtools/testopia/template/en/default/testopia/reports/build-coverage.html.tmpl index a097807298c..db3ed81895e 100644 --- a/mozilla/webtools/testopia/template/en/default/testopia/reports/build-coverage.html.tmpl +++ b/mozilla/webtools/testopia/template/en/default/testopia/reports/build-coverage.html.tmpl @@ -38,11 +38,11 @@ [% PROCESS testopia/style.none.tmpl %] - +
- + [% FOREACH b = report.builds %] - + [% END %] [% FOREACH case = report.keys %] diff --git a/mozilla/webtools/testopia/template/en/default/testopia/search/advanced.html.tmpl b/mozilla/webtools/testopia/template/en/default/testopia/search/advanced.html.tmpl index 8a6e296fcf5..6ae09b29956 100644 --- a/mozilla/webtools/testopia/template/en/default/testopia/search/advanced.html.tmpl +++ b/mozilla/webtools/testopia/template/en/default/testopia/search/advanced.html.tmpl @@ -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" }, ] %] @@ -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 %] diff --git a/mozilla/webtools/testopia/template/en/default/testopia/search/case.html.tmpl b/mozilla/webtools/testopia/template/en/default/testopia/search/case.html.tmpl index 6c5136fefde..437519395b9 100644 --- a/mozilla/webtools/testopia/template/en/default/testopia/search/case.html.tmpl +++ b/mozilla/webtools/testopia/template/en/default/testopia/search/case.html.tmpl @@ -20,55 +20,10 @@ [% IF report %] - -

- Choose one or more fields as your axes, and then refine your set of - cases using the rest of the form. -

- - -
    Build
Case
 [% b.value %]
- - - - - - - - - -
- - Horizontal Axis: - [% PROCESS select sel = { name => 'x_axis_field', - list => case.report_columns } %] - -
- Vertical Axis:
- [% PROCESS select sel = { name => 'y_axis_field', - list => case.report_columns } %] - -
- - - - -
- Multiple Tables:
- [% PROCESS select sel = { name => 'z_axis_field', - list => case.report_columns } %] - -
-
- -
- -
- - - - -
+ +[% PROCESS "testopia/search/report-matrix.html.tmpl" + obj = case +%] [% ELSE %] [% END %] diff --git a/mozilla/webtools/testopia/template/en/default/testopia/search/caserun.html.tmpl b/mozilla/webtools/testopia/template/en/default/testopia/search/caserun.html.tmpl new file mode 100644 index 00000000000..4405c3b6339 --- /dev/null +++ b/mozilla/webtools/testopia/template/en/default/testopia/search/caserun.html.tmpl @@ -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 + #%] + + +[% IF report %] + +[% PROCESS "testopia/search/report-matrix.html.tmpl" + obj = caserun +%] +[% ELSE %] + +[% END %] + + +
+ Product + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
StatusProductComponentsCategoryPriorityAutomatic
+ [% PROCESS select sel = { name => "case_run_status_id", + list => caserun.get_status_list, + elements => 6, + mult => 1, } + %] + + [% PROCESS select sel = { name => 'product_id', + accesskey => 'p', + list => plan.get_available_products, + elements => 5, + mult => 1 + events => 'onChange="onProductSelection()"' } %] + + [% PROCESS select sel = { name => 'component', + accesskey => 'm', + list => case.get_available_components + elements => 5, + mult => 1 } %] + + [% PROCESS select sel = { name => 'category', + accesskey => 't', + list => case.get_category_list(1), + elements => 5, + mult => 1 } %] + + [% PROCESS select sel = { name => 'priority_id', + accesskey => 'p', + list => case.get_priority_list + elements => 5, + mult => 1 } %] + + [% PROCESS select sel = { name => 'isautomated', + accesskey => 'a', + list => + [ { id => "0", name => "Manual" }, + { id => "1", name => "Automatic" } ] + elements => 5, + mult => 1 } %] +
Run StatusVersionBuildMilestoneEnvironment
+ [% PROCESS select sel = { name => 'run_status', + accesskey => 's', + list => run.get_status_list + elements => 5, + mult => 1 } %] + + [% PROCESS select sel = { name => 'run_product_version', + accesskey => 'v', + list => product_versions, + elements => 5, + mult => 1 } %] + + [% PROCESS select sel = { name => 'build', + accesskey => 't', + list => run.get_distinct_builds, + elements => 5, + mult => 1 } %] + + [% PROCESS select sel = { name => 'milestone', + accesskey => 'm', + list => run.get_distinct_milestones, + elements => 5, + mult => 1 } %] + + [% PROCESS select sel = { name => 'environment', + accesskey => 'e', + list => run.get_environments, + elements => 5, + mult => 1 } %] +
+ +
+
+ Attributes + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Assignee + [% PROCESS select sel = { name => 'assignee_type', + list => email_variants } %] + + AND + OR
Tested By + [% PROCESS select sel = { name => 'testedby_type', + list => email_variants } %] + +
Case Summary + [% PROCESS select sel = { name => 'case_summary_type', + list => query_variants } %] + +
Requirement + [% PROCESS select sel = { name => 'requirement_type', + list => query_variants } %] + +
Environment + [% PROCESS select sel = { name => 'environment_type', + list => query_variants } %] + +
Case Tags + [% PROCESS select sel = { name => 'tags_type', + list => tag_variants } %] + +
Notes + [% PROCESS select sel = { name => 'notes_type', + list => query_variants } %] + +
+
+ +

+ + +

+ + +

+ + +

+ +

+ + + diff --git a/mozilla/webtools/testopia/template/en/default/testopia/search/plan.html.tmpl b/mozilla/webtools/testopia/template/en/default/testopia/search/plan.html.tmpl index 3f87f05868b..5d01c11e10c 100644 --- a/mozilla/webtools/testopia/template/en/default/testopia/search/plan.html.tmpl +++ b/mozilla/webtools/testopia/template/en/default/testopia/search/plan.html.tmpl @@ -20,54 +20,9 @@ [% IF report %]
-

- Choose one or more fields as your axes, and then refine your set of - plans using the rest of the form. -

- - - - - - - - - - - - -
- - Horizontal Axis: - [% PROCESS select sel = { name => 'x_axis_field', - list => plan.report_columns } %] - -
- Vertical Axis:
- [% PROCESS select sel = { name => 'y_axis_field', - list => plan.report_columns } %] - -
- - - - -
- Multiple Tables:
- [% PROCESS select sel = { name => 'z_axis_field', - list => plan.report_columns } %] - -
-
- -
- -
- - - - -
+[% PROCESS "testopia/search/report-matrix.html.tmpl" + obj = plan +%] [% ELSE %] [% END %] diff --git a/mozilla/webtools/testopia/template/en/default/testopia/search/report-matrix.html.tmpl b/mozilla/webtools/testopia/template/en/default/testopia/search/report-matrix.html.tmpl new file mode 100644 index 00000000000..797d248107c --- /dev/null +++ b/mozilla/webtools/testopia/template/en/default/testopia/search/report-matrix.html.tmpl @@ -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 + #%] + +

+ 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. +

+ + + + + + + + + + + + +
+ + Horizontal Axis: + [% PROCESS select sel = { name => 'x_axis_field', + list => obj.report_columns } %] + +
+ Vertical Axis:
+ [% PROCESS select sel = { name => 'y_axis_field', + list => obj.report_columns } %] + +
+ + + + +
+ Multiple Tables:
+ [% PROCESS select sel = { name => 'z_axis_field', + list => obj.report_columns } %] + +
+
+ +
+ + + diff --git a/mozilla/webtools/testopia/template/en/default/testopia/search/run.html.tmpl b/mozilla/webtools/testopia/template/en/default/testopia/search/run.html.tmpl index 92701845c4c..8413f6d89dc 100644 --- a/mozilla/webtools/testopia/template/en/default/testopia/search/run.html.tmpl +++ b/mozilla/webtools/testopia/template/en/default/testopia/search/run.html.tmpl @@ -20,54 +20,9 @@ [% IF report %] -

- Choose one or more fields as your axes, and then refine your set of - runs using the rest of the form. -

- - - - - - - - - - - - -
- - Horizontal Axis: - [% PROCESS select sel = { name => 'x_axis_field', - list => run.report_columns } %] - -
- Vertical Axis:
- [% PROCESS select sel = { name => 'y_axis_field', - list => run.report_columns } %] - -
- - - - -
- Multiple Tables:
- [% PROCESS select sel = { name => 'z_axis_field', - list => run.report_columns } %] - -
-
- -
- -
- - - - -
+[% PROCESS "testopia/search/report-matrix.html.tmpl" + obj = run +%] [% ELSE %] [% END %] diff --git a/mozilla/webtools/testopia/template/en/default/testopia/text.png.tmpl b/mozilla/webtools/testopia/template/en/default/testopia/text.png.tmpl new file mode 100644 index 00000000000..d6ab78ee32a --- /dev/null +++ b/mozilla/webtools/testopia/template/en/default/testopia/text.png.tmpl @@ -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; + -%] \ No newline at end of file diff --git a/mozilla/webtools/testopia/tr_caserun_reports.cgi b/mozilla/webtools/testopia/tr_caserun_reports.cgi new file mode 100644 index 00000000000..684f725b63a --- /dev/null +++ b/mozilla/webtools/testopia/tr_caserun_reports.cgi @@ -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 +# Ed Fuentetaja +# Greg Hendricks + +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; +} diff --git a/mozilla/webtools/testopia/tr_draw.cgi b/mozilla/webtools/testopia/tr_draw.cgi new file mode 100644 index 00000000000..236cac398c8 --- /dev/null +++ b/mozilla/webtools/testopia/tr_draw.cgi @@ -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 + +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()); \ No newline at end of file diff --git a/mozilla/webtools/testopia/tr_list_caseruns.cgi b/mozilla/webtools/testopia/tr_list_caseruns.cgi index e26852cf16d..979c811bb77 100755 --- a/mozilla/webtools/testopia/tr_list_caseruns.cgi +++ b/mozilla/webtools/testopia/tr_list_caseruns.cgi @@ -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; diff --git a/mozilla/webtools/testopia/tr_plan_reports.cgi b/mozilla/webtools/testopia/tr_plan_reports.cgi index f3bc5f4107a..facf530df3d 100755 --- a/mozilla/webtools/testopia/tr_plan_reports.cgi +++ b/mozilla/webtools/testopia/tr_plan_reports.cgi @@ -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()); diff --git a/mozilla/webtools/testopia/tr_query.cgi b/mozilla/webtools/testopia/tr_query.cgi index fcc828ead87..46c1006ca17 100755 --- a/mozilla/webtools/testopia/tr_query.cgi +++ b/mozilla/webtools/testopia/tr_query.cgi @@ -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 = ""; foreach my $value (@$versions){ @@ -81,6 +82,9 @@ if ($action eq 'getversions'){ foreach my $value (@$categories){ $ret .= "". xml_quote($value->{'name'}) .""; } + foreach my $value (@$environments){ + $ret .= "". xml_quote($value->{'name'}) .""; + } $ret .= ""; 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 });