- enable new testcases by default

b=384366
- change link text to "view/search tests"

b=387475
- add query to footer to show ungrouped testcases

b=389013
- prefill product and branch on new testcases

b=344703
- remember filter state after submitting testcase changes in manage_*.cgi

b=363001
- add query option to advanced_search to search for results with/without bugs specified

b=363293
- add testcase preview to results page
This commit is contained in:
ccooper%deadsquid.com 2007-08-14 17:41:23 +00:00
Родитель b886400446
Коммит 07658fa91d
31 изменённых файлов: 367 добавлений и 77 удалений

Просмотреть файл

@ -143,6 +143,12 @@ WHERE
tc.community_enabled=1
});
__PACKAGE__->set_sql(Ungrouped => qq{
SELECT tc.*
FROM testcases tc LEFT JOIN testcase_subgroups tcsg ON (tc.testcase_id=tcsg.testcase_id)
WHERE tcsg.subgroup_id IS NULL
});
#########################################################################
# isCompleted($$$$$)
#

Просмотреть файл

@ -261,6 +261,16 @@ sub getTestResults($\@\@$) {
$where .= " AND tr.is_automated_result=";
$where .= $criterion->{'value'} == 1 ? '1' : '0';
}
} elsif ($criterion->{'field'} eq 'withbugs') {
if ($criterion->{'value'} ne 'all') {
if ($criterion->{'value'} eq '1') {
$from .= ", test_result_bugs trb";
$where .= " AND tr.testresult_id=trb.test_result_id";
} else {
$from =~ s/test_results tr,/test_results tr LEFT JOIN test_result_bugs trb ON (tr.testresult_id=trb.test_result_id),/;
$where .= " AND trb.bug_id IS NULL";
}
}
} elsif ($criterion->{'field'} eq 'user_id') {
if ($from !~ /users u/) {
$from .= ", users u";

Просмотреть файл

@ -172,6 +172,19 @@ if ($c->param) {
$limit_criteria .= "Display manual results only<br/>";
}
}
} elsif ($param eq 'withbugs') {
my $value = $c->param($param);
if ($value ne 'all') {
if ($value eq '1') {
push @where, {field => 'withbugs',
value => 1};
$limit_criteria .= "Results with associated bugs<br/>";
} else {
push @where, {field => 'withbugs',
value => '0E0'};
$limit_criteria .= "Results without associated bugs<br/>";
}
}
} elsif ($param eq 'my_results_only') {
push @where, {field => 'user_id',
value => $cookie->{'user_id'}};

Просмотреть файл

@ -182,6 +182,7 @@ function populateSubgroup(data) {
function blankSubgroupForm(formid) {
blankForm(formid);
updatePersistVars();
document.getElementById('subgroup_id_display').innerHTML = '';
var selectBoxAll = document.getElementById('testcases_for_product');
selectBoxAll.options.length = 0;
@ -203,10 +204,10 @@ function blankSubgroupForm(formid) {
function switchToAdd() {
disableModeButtons();
blankSubgroupForm('edit_subgroup_form');
document.getElementById('subgroup_id_display').innerHTML = '<em>Automatically generated for a new subgroup</em>';
document.getElementById('subgroup_id_display_edit').innerHTML = '<em>Automatically generated for a new subgroup</em>';
document.getElementById('testgroups_link_display').innerHTML = '<em>A new subgroup does not belong to any testgroups by default.<br/>Use the <a target="manage_testgroups" href="manage_testgroups.cgi">Manage Testgroups</a> interface to assign the subgroup to testgroups after the new subgroup is created.</em>';
document.getElementById('testrunner_group_id').innerHTML = '<em>Not Applicable</em>';
document.getElementById('submit').value = 'Add Subgroup';
document.getElementById('testrunner_group_id').innerHTML = '<em>Not Applicable</em>';
document.getElementById('submit').value = 'Add Subgroup';
document.getElementById('mode').value = 'add';
enableForm('edit_subgroup_form');
document.getElementById('subgroup_display_div').style.display = 'none';
@ -279,5 +280,24 @@ function previewTestcase(selectID) {
}
}
function updatePersistVars() {
var productBox = document.getElementById('product_filter');
var branchBox = document.getElementById('branch_filter');
var testgroupBox = document.getElementById('testgroup_filter');
if (productBox.selectedIndex) {
var productPersist = document.getElementById('product_persist');
productPersist.value = productBox.options[productBox.selectedIndex].value;
}
if (branchBox.selectedIndex) {
var branchPersist = document.getElementById('branch_persist');
branchPersist.value = branchBox.options[branchBox.selectedIndex].value;
}
if (testgroupBox.selectedIndex) {
var testgroupPersist = document.getElementById('testgroup_persist');
testgroupPersist.value = testgroupBox.options[testgroupBox.selectedIndex].value;
}
}
var manageTestcasesHelpTitle="Help with Managing Testcases";
var manageTestcasesHelpText="<p>The select box on the left contains all the testcases for the chosen product, <strong><em>INCLUDING</em></strong> any testcases already contained in the subgroup. You can use the <input type='button' value='&rArr;' disabled> button to add testcases to the subgroup, and the <input type='button' value='&lArr;' disabled> button to remove testcases from the subgroup. <strong>NOTE</strong>: neither of the actions will alter the list of testcases on the left.</p><p>You can preview any testcase from the left-hand select box by selecting the testcase, and then clicking on the 'Preview Testcase' link below the select box. If more than one testcase is selected, only the first testcase will be previewed.</p><p>You can change the display order of testcases within the subgroup using the <input type='button' value='&uArr;' disabled> and <input type='button' value='&dArr;' disabled> buttons to the right of the right-hand select box. Testcases can be re-ordered singly or in groups by selecting multiple testcases in the right-hand select box.</p>";

Просмотреть файл

@ -67,7 +67,7 @@ function filterList() {
filter_req = doSimpleXMLHttpRequest('manage_test_runs.cgi', {
searchTestRunList: 1,
product: (productfilter.options[productfilter.selectedIndex].value == '' ? '' : productfilter.options[productfilter.selectedIndex].value),
branch: (branchfilter.options[branchfilter.selectedIndex].value == '' ? '' : branchfilter.options[branchfilter.selectedIndex].value),
branch: (branchfilter.options[branchfilter.selectedIndex].value == '' ? '' : branchfilter.options[branchfilter.selectedIndex].value)
});
// if something went wrong, just show all the tests:
@ -112,7 +112,7 @@ function loadTestRun(silent) {
toggleMessage('loading','Loading Test Run ID# ' + test_run_id + '...');
}
var url = 'json.cgi?test_run_id=' + test_run_id;
fetchJSON(url,populateTestRun,silent);
return fetchJSON(url,populateTestRun,silent);
}
function populateTestRun(data) {
@ -142,7 +142,7 @@ function populateTestRun(data) {
}
}
changeProduct();
changeProduct('');
var branchBox = document.getElementById('branch');
populateBranches(branchBox,productBox);
var found_branch = setSelected(branchBox,test_run.branch_id.branch_id);
@ -257,6 +257,7 @@ function populateAllTestgroups() {
function blankTestRunForm(formid) {
blankForm(formid);
updatePersistVars();
resetTable('tblNewCriteria');
addRowToTable('tblNewCriteria');
document.getElementById('test_run_id_display').innerHTML = '';
@ -276,7 +277,7 @@ function blankTestRunForm(formid) {
test_run = new Object();
changeProduct();
changeProduct('');
var productBox = document.getElementById('product');
var branchBox = document.getElementById('branch');
populateBranches(branchBox,productBox);
@ -439,3 +440,15 @@ function previewTestgroup(selectID) {
}
}
function updatePersistVars() {
var productBox = document.getElementById('product_filter');
var branchBox = document.getElementById('branch_filter');
if (productBox.selectedIndex) {
var productPersist = document.getElementById('product_persist');
productPersist.value = productBox.options[productBox.selectedIndex].value;
}
if (branchBox.selectedIndex) {
var branchPersist = document.getElementById('branch_persist');
branchPersist.value = branchBox.options[branchBox.selectedIndex].value;
}
}

Просмотреть файл

@ -1,5 +1,6 @@
var testcase;
var filter_req;
var initial_load = 1;
var showAllTests = function(err) {
// if they cancelled, then just don't change anything:
@ -74,7 +75,7 @@ function filterList() {
testgroup: (testgroupfilter.options[testgroupfilter.selectedIndex].value == '' ?
'' : testgroupfilter.options[testgroupfilter.selectedIndex].value),
subgroup: (subgroupfilter.options[subgroupfilter.selectedIndex].value == '' ?
'' : subgroupfilter.options[subgroupfilter.selectedIndex].value),
'' : subgroupfilter.options[subgroupfilter.selectedIndex].value)
});
// if something went wrong, just show all the tests:
filter_req.addErrback(showAllTests);
@ -118,7 +119,7 @@ function loadTestcase(silent) {
toggleMessage('loading','Loading Testcase ID# ' + testcase_id + '...');
}
var url = 'json.cgi?testcase_id=' + testcase_id;
fetchJSON(url,populateTestcase,silent);
return fetchJSON(url,populateTestcase,silent);
}
function populateTestcase(data) {
@ -244,6 +245,9 @@ function populateTestcase(data) {
function blankTestcaseForm(formid) {
blankForm(formid);
updatePersistVars();
document.getElementById('enabled').checked = true;
document.getElementById('communityenabled').checked = true;
document.getElementById('testcase_id_display').innerHTML = '';
document.getElementById('creation_date').innerHTML = '';
document.getElementById('last_updated').innerHTML = '';
@ -258,13 +262,34 @@ function switchToAdd() {
blankTestcaseForm('edit_testcase_form');
var productBox = document.getElementById('product');
loadProducts(productBox,'',1);
var productfilter = document.getElementById('product_filter');
if (productfilter.selectedIndex) {
var productId = productfilter.options[productfilter.selectedIndex].value;
for (var i=0; i<productBox.options.length; i++) {
if (productBox.options[i].value == productId) {
productBox.options[i].selected = true;
break;
}
}
}
changeProduct();
var branchBox = document.getElementById('branch');
var branchfilter = document.getElementById('branch_filter');
if (branchfilter.selectedIndex) {
var branchId = branchfilter.options[branchfilter.selectedIndex].value;
for (var i=0; i<branchBox.options.length; i++) {
if (branchBox.options[i].value == branchId) {
branchBox.options[i].selected = true;
break;
}
}
}
setAuthor(current_user_id);
document.getElementById('submit').value = 'Add Testcase';
document.getElementById('mode').value = 'add';
enableForm('edit_testcase_form');
document.getElementById('testcase_display_div').style.display = 'none';
document.getElementById('testcase_id_display').innerHTML = '<em>Automatically generated for a new testcase</em>';
document.getElementById('testcase_id_display_edit').innerHTML = '<em>Automatically generated for a new testcase</em>';
document.getElementById('testgroups_link_display').innerHTML = '<em>A new testcase does not belong to any testgroups by default.<br/>Use the <a target="manage_testgroups" href="manage_testgroups.cgi">Manage Testgroups</a> interface to assign the subgroups to testgroups after the new testcase is created.</em>';
document.getElementById('subgroups_link_display').innerHTML = '<em>A new testcase does not belong to any subgroups by default.<br/>Use the <a target="manage_subgroups" href="manage_subgroups.cgi">Manage Subgroups</a> interface to assign the new testcase to subgroups once it is created.</em>';
document.getElementById('creation_date').innerHTML = '<em>Automatically generated for a new testcase</em>';
@ -305,3 +330,79 @@ function generateBugLink(bugID) {
return 'https://bugzilla.mozilla.org/show_bug.cgi?id=' + bugID;
}
function updatePersistVars() {
var productBox = document.getElementById('product_filter');
var branchBox = document.getElementById('branch_filter');
var testgroupBox = document.getElementById('testgroup_filter');
var subgroupBox = document.getElementById('subgroup_filter');
if (productBox.selectedIndex) {
var productPersist = document.getElementById('product_persist');
productPersist.value = productBox.options[productBox.selectedIndex].value;
}
if (branchBox.selectedIndex) {
var branchPersist = document.getElementById('branch_persist');
branchPersist.value = branchBox.options[branchBox.selectedIndex].value;
}
if (testgroupBox.selectedIndex) {
var testgroupPersist = document.getElementById('testgroup_persist');
testgroupPersist.value = testgroupBox.options[testgroupBox.selectedIndex].value;
}
if (subgroupBox.selectedIndex) {
var subgroupPersist = document.getElementById('subgroup_persist');
subgroupPersist.value = subgroupBox.options[subgroupBox.selectedIndex].value;
}
}
function changeTestgroupFirstPass(mySuffix,silent) {
if (!mySuffix) {
mySuffix=suffix;
}
var subgroupBox = document.getElementById('subgroup'+mySuffix);
if (subgroupBox) {
loadSubgroupsFirstPass(subgroupBox,mySuffix,silent);
}
}
function loadSubgroupsFirstPass(subgroupBox,mySuffix,silent) {
if (!mySuffix) {
mySuffix=suffix;
}
var testgroupBox = document.getElementById('testgroup'+mySuffix);
var testgroupId = testgroupBox.options[testgroupBox.selectedIndex].value;
if (!testgroupId) {
// No testgroup selected.
return undefined;
}
disableForm(formName);
if (!silent) {
toggleMessage('loading','Loading Subgroups...');
}
var url = 'json.cgi?testgroup_id=' + testgroupId;
return fetchJSON(url,populateSubgroupsFirstPass,silent);
}
function populateSubgroupsFirstPass(data) {
testgroup=data;
if (typeof(subgroupBox) == "undefined") {
subgroupBox = document.getElementById('subgroup'+suffix);
}
clearSelect(subgroupBox);
addNullEntry(subgroupBox);
if (testgroup) {
for (var i=0; i<testgroup.subgroups.length; i++) {
var optionText = testgroup.subgroups[i].name + ' (' + testgroup.subgroups[i].subgroup_id + ')';
subgroupBox.options[subgroupBox.length] = new Option(optionText,
testgroup.subgroups[i].subgroup_id);
}
}
if (initial_subgroup) {
setSelected(subgroupBox,initial_subgroup);
initial_subgroup=0;
}
toggleMessage('loading','Filtering testcase list...');
filterList();
toggleMessage('none');
enableForm(formName);
}

Просмотреть файл

@ -58,7 +58,7 @@ function filterList() {
filter_req = doSimpleXMLHttpRequest('manage_testgroups.cgi', {
searchTestgroupList: 1,
product: (productfilter.options[productfilter.selectedIndex].value == '' ? '' : productfilter.options[productfilter.selectedIndex].value),
branch: (branchfilter.options[branchfilter.selectedIndex].value == '' ? '' : branchfilter.options[branchfilter.selectedIndex].value),
branch: (branchfilter.options[branchfilter.selectedIndex].value == '' ? '' : branchfilter.options[branchfilter.selectedIndex].value)
});
// if something went wrong, just show all the tests:
filter_req.addErrback(showAll);
@ -97,7 +97,7 @@ function loadTestgroup(silent) {
toggleMessage('loading','Loading Testgroup ID# ' + testgroup_id + '...');
}
var url = 'json.cgi?testgroup_id=' + testgroup_id;
fetchJSON(url,populateTestgroup,silent);
return fetchJSON(url,populateTestgroup,silent);
}
function populateTestgroup(data) {
@ -160,6 +160,7 @@ function populateTestgroup(data) {
function blankTestgroupForm(formid) {
blankForm(formid);
updatePersistVars();
document.getElementById('testgroup_id_display').innerHTML = '';
var selectBoxAll = document.getElementById('subgroups_for_product');
selectBoxAll.options.length = 0;
@ -187,7 +188,7 @@ function switchToAdd() {
disableModeButtons();
blankTestgroupForm('edit_testgroup_form');
document.getElementById('testgroup_id_display').innerHTML = '<em>Automatically generated for a new testgroup</em>';
document.getElementById('testrunner_plan_id').innerHTML = '<em>Not Applicable</em>';
document.getElementById('testrunner_plan_id').innerHTML = '<em>Not Applicable</em>';
document.getElementById('submit').value = 'Add Testgroup';
document.getElementById('mode').value = 'add';
enableForm('edit_testgroup_form');
@ -267,5 +268,18 @@ function previewSubgroup(selectID) {
}
}
function updatePersistVars() {
var productBox = document.getElementById('product_filter');
var branchBox = document.getElementById('branch_filter');
if (productBox.selectedIndex) {
var productPersist = document.getElementById('product_persist');
productPersist.value = productBox.options[productBox.selectedIndex].value;
}
if (branchBox.selectedIndex) {
var branchPersist = document.getElementById('branch_persist');
branchPersist.value = branchBox.options[branchBox.selectedIndex].value;
}
}
var manageTestgroupsHelpTitle="Help with Managing Testgroups";
var manageTestgroupsHelpText="<p>The select box on the left contains all the subgroups for the chosen product, <strong><em>INCLUDING</em></strong> any subgroups already contained in the testgroup. You can use the <input type='button' value='&rArr;' disabled> button to add subgroups to the testgroup, and the <input type='button' value='&lArr;' disabled> button to remove subgroups from the testgroup. <strong>NOTE</strong>: neither of the actions will alter the list of subgroups on the left.</p><p>You can preview any subgroup from the left-hand select box by selecting the subgroup, and then clicking on the 'Preview Subgroup' link below the select box. If more than one subgroup is selected, only the first subgroup will be previewed.</p><p>You can change the display order of subgroups within the testgroup using the <input type='button' value='&uArr;' disabled> and <input type='button' value='&dArr;' disabled> buttons to the right of the right-hand select box. Subgroups can be re-ordered singly or in groups by selecting multiple subgroups in the right-hand select box.</p>";

4
webtools/litmus/js/MochiKit/MochiKit.js поставляемый
Просмотреть файл

@ -2255,10 +2255,10 @@ _290=304;
}
catch(e){
}
if(_290==200||_290==304){
if(_290==200||_290==304||_290==500){
d.callback(this);
}else{
var err=new MochiKit.Async.XMLHttpRequestError(this,"Request failed");
var err=new MochiKit.Async.XMLHttpRequestError(this,this.status+": Request failed");
if(err.number){
d.errback(err);
}else{

Просмотреть файл

@ -8,6 +8,7 @@ function getProductById(productId) {
return (products[i]);
}
}
return undefined;
}
function getTestgroupById(testgroupId) {
@ -16,6 +17,7 @@ function getTestgroupById(testgroupId) {
return (testgroups[i]);
}
}
return undefined;
}
function getPlatformById(platformId) {
@ -24,6 +26,7 @@ function getPlatformById(platformId) {
return (platforms[i]);
}
}
return undefined;
}
// pass this the <input> containing the list of possible default values
@ -201,14 +204,16 @@ function loadSubgroups(subgroupBox,mySuffix,silent) {
var testgroupId = testgroupBox.options[testgroupBox.selectedIndex].value;
if (!testgroupId) {
// No testgroup selected.
return;
clearSelect(subgroupBox);
addNullEntry(subgroupBox);
return undefined;
}
disableForm(formName);
if (!silent) {
toggleMessage('loading','Loading Subgroups...');
}
var url = 'json.cgi?testgroup_id=' + testgroupId;
fetchJSON(url,populateSubgroups,silent);
return fetchJSON(url,populateSubgroups,silent);
}
function populateSubgroups(data) {
@ -227,8 +232,8 @@ function populateSubgroups(data) {
testgroup.subgroups[i].subgroup_id);
}
}
toggleMessage('none');
FormInit(document.forms[formName], document.location.search, 'subgroup'+suffix);
toggleMessage('none');
enableForm(formName);
}
@ -360,4 +365,4 @@ function setSelected(selectBox,selectedValue) {
options[0].selected = true;
}
return found_selected;
}
}

Просмотреть файл

@ -78,6 +78,13 @@ if ($c->param("searchSubgroupList")) {
# get here, then you need to be an admin:
Litmus::Auth::requireProductAdmin('manage_subgroups.cgi');
my $product_persist = $c->param('product_persist') ? $c->param('product_persist') : 0;
my $branch_persist = $c->param('branch_persist') ? $c->param('branch_persist') : 0;
my $testgroup_persist = $c->param('testgroup_persist') ? $c->param('testgroup_persist') : 0;
$vars->{'product_persist'} = $product_persist;
$vars->{'branch_persist'} = $branch_persist;
$vars->{'testgroup_persist'} = $testgroup_persist;
if ($c->param("subgroup_id")) {
$subgroup_id = $c->param("subgroup_id");
}
@ -115,6 +122,7 @@ if ($c->param("delete_subgroup_button")) {
requireField('product', $c->param('product'));
requireField('branch', $c->param('branch'));
my $enabled = $c->param('enabled') ? 1 : 0;
if ($c->param("mode") eq "add") {
Litmus::Auth::requireProductAdmin("manage_subgroups.cgi", $c->param('product'));
my %hash = (

Просмотреть файл

@ -40,6 +40,35 @@ use CGI;
use Date::Manip;
use JSON;
#########################################################################
sub getCriteria {
my ($c) = @_;
my $matched_rows;
my @criteria;
for my $param ($c->param) {
if ($param =~ /^build_id_new_(\d+)$/ or
$param =~ /^platform_new_(\d+)$/ or
$param =~ /^opsys_new_(\d+)$/) {
my $row_id = $1;
next if ($matched_rows->{$row_id});
my $hash;
$hash->{'build_id'} = $c->param("build_id_new_$row_id") ? $c->param("build_id_new_$row_id") : '';
$hash->{'platform_id'} = $c->param("platform_new_$row_id") ? $c->param("platform_new_$row_id") : 0;
$hash->{'opsys_id'} = $c->param($param) ? $c->param("opsys_new_$row_id") : 0;
push @criteria, $hash;
$matched_rows->{$row_id} = 1;
}
}
return \@criteria;
}
#########################################################################
my $c = Litmus->cgi();
my $vars;
@ -72,6 +101,11 @@ if ($c->param("searchTestRunList")) {
Litmus::Auth::requireRunDayAdmin('manage_test_runs.cgi');
my $product_persist = $c->param('product_persist') ? $c->param('product_persist') : 0;
my $branch_persist = $c->param('branch_persist') ? $c->param('branch_persist') : 0;
$vars->{'product_persist'} = $product_persist;
$vars->{'branch_persist'} = $branch_persist;
if ($c->param("test_run_id")) {
$test_run_id = $c->param("test_run_id");
}
@ -124,6 +158,7 @@ if ($c->param("delete_test_run_button")) {
my $now = &UnixDate("today", "%q");
my @selected_testgroups = $c->param("test_run_testgroups");
my $criteria = &getCriteria($c);
if ($c->param("mode") eq "add") {
my %hash = (
name => $c->param('name'),
@ -287,30 +322,3 @@ print $c->header();
Litmus->template()->process("admin/manage_test_runs.tmpl", $vars) ||
internalError("Error loading template: $@\n");
#########################################################################
sub getCriteria {
my ($c) = @_;
my $matched_rows;
my @criteria;
for my $param ($c->param) {
if ($param =~ /^build_id_new_(\d+)$/ or
$param =~ /^platform_new_(\d+)$/ or
$param =~ /^opsys_new_(\d+)$/) {
my $row_id = $1;
next if ($matched_rows->{$row_id});
my $hash;
$hash->{'build_id'} = $c->param("build_id_new_$row_id") ? $c->param("build_id_new_$row_id") : '';
$hash->{'platform_id'} = $c->param("platform_new_$row_id") ? $c->param("platform_new_$row_id") : 0;
$hash->{'opsys_id'} = $c->param($param) ? $c->param("opsys_new_$row_id") : 0;
push @criteria, $hash;
$matched_rows->{$row_id} = 1;
}
}
return \@criteria;
}

Просмотреть файл

@ -80,6 +80,15 @@ if ($c->param("searchTestcaseList")) {
# get here, then you need to be an admin:
Litmus::Auth::requireProductAdmin('manage_testcases.cgi');
my $product_persist = $c->param('product_persist') ? $c->param('product_persist') : 0;
my $branch_persist = $c->param('branch_persist') ? $c->param('branch_persist') : 0;
my $testgroup_persist = $c->param('testgroup_persist') ? $c->param('testgroup_persist') : 0;
my $subgroup_persist = $c->param('subgroup_persist') ? $c->param('subgroup_persist') : 0;
$vars->{'product_persist'} = $product_persist;
$vars->{'branch_persist'} = $branch_persist;
$vars->{'testgroup_persist'} = $testgroup_persist;
$vars->{'subgroup_persist'} = $subgroup_persist;
if ($c->param("testcase_id")) {
$testcase_id = $c->param("testcase_id");
if ($c->param("edit")) {
@ -129,6 +138,7 @@ if ($c->param("delete_testcase_button")) {
my $enabled = $c->param('enabled') ? 1 : 0;
my $community_enabled = $c->param('communityenabled') ? 1 : 0;
my $now = &UnixDate("today","%q");
if ($c->param("mode") eq "add") {
Litmus::Auth::requireProductAdmin("manage_testcases.cgi", $c->param('product'));
my %hash = (

Просмотреть файл

@ -72,6 +72,11 @@ if ($c->param("searchTestgroupList")) {
# get here, then you need to be an admin:
Litmus::Auth::requireProductAdmin('manage_testgroups.cgi');
my $product_persist = $c->param('product_persist') ? $c->param('product_persist') : 0;
my $branch_persist = $c->param('branch_persist') ? $c->param('branch_persist') : 0;
$vars->{'product_persist'} = $product_persist;
$vars->{'branch_persist'} = $branch_persist;
if ($c->param("testgroup_id")) {
$testgroup_id = $c->param("testgroup_id");
}
@ -109,6 +114,7 @@ if ($c->param("delete_testgroup_button")) {
requireField('product', $c->param('product'));
requireField('branch', $c->param('branch'));
my $enabled = $c->param('enabled') ? 1 : 0;
if ($c->param("mode") eq "add") {
Litmus::Auth::requireProductAdmin("manage_testgroups.cgi", $c->param('product'));
my %hash = (

Просмотреть файл

@ -56,12 +56,12 @@
<tr>
<td>select</td>
<td>product</td>
<td>label=Firefox (1)</td>
<td>label=Thunderbird (3)</td>
</tr>
<tr>
<td>select</td>
<td>branch</td>
<td>label=Trunk (1)</td>
<td>label=Trunk (5)</td>
</tr>
<tr>
<td>click</td>
@ -95,7 +95,7 @@
</tr>
<tr>
<td>verifyTextPresent</td>
<td>Firefox</td>
<td>Thunderbird</td>
<td></td>
</tr>
<tr>

Просмотреть файл

@ -30,7 +30,7 @@
</tr>
<tr>
<td>verifyTextPresent</td>
<td>Firefox</td>
<td>Thunderbird</td>
<td></td>
</tr>
<tr>

Просмотреть файл

@ -51,7 +51,7 @@
<tr>
<td>verifySelectedLabel</td>
<td>product</td>
<td>Firefox*</td>
<td>Thunderbird*</td>
</tr>
<tr>
<td>verifySelectedLabel</td>
@ -66,7 +66,7 @@
<tr>
<td>select</td>
<td>branch</td>
<td>label=2.0 Branch (11)</td>
<td>label=2.0 Branch (12)</td>
</tr>
<tr>
<td>type</td>
@ -90,7 +90,7 @@
</tr>
<tr>
<td>verifyTextPresent</td>
<td>Firefox</td>
<td>Thunderbird</td>
<td></td>
</tr>
<tr>

Просмотреть файл

@ -16,7 +16,7 @@
<tr>
<td>select</td>
<td>product_filter</td>
<td>label=Firefox (1)</td>
<td>label=Thunderbird (3)</td>
</tr>
<tr>
<td>waitForElementNotPresent</td>
@ -26,7 +26,7 @@
<tr>
<td>select</td>
<td>branch_filter</td>
<td>label=Trunk (1)</td>
<td>label=Trunk (5)</td>
</tr>
<tr>
<td>waitForElementNotPresent</td>
@ -50,7 +50,7 @@
</tr>
<tr>
<td>verifyTextPresent</td>
<td>Firefox</td>
<td>Thunderbird</td>
<td></td>
</tr>
<tr>

Просмотреть файл

@ -230,6 +230,12 @@ if ($c->param('searchType') eq 'fulltext') {
($product ? "product: ".$product->name() : '').
($testgroup ? " | testgroup: ".$testgroup->name() : '').
($subgroup ? " | subgroup: ".$subgroup->name() : '');
} elsif ($c->param('searchType') eq 'ungrouped') {
my @testcases = Litmus::DB::Testcase->search_Ungrouped();
my $search_string_for_display = "Testcases not associated with any subgroup.";
$vars->{'testcases'} = \@testcases;
$vars->{'search_string_for_display'} = $search_string_for_display;
}
if ($c->param('searchType')) {

Просмотреть файл

@ -32,11 +32,14 @@
<form id="edit_subgroup_form" name="edit_subgroup_form" method="post" action="manage_subgroups.cgi" onSubmit="selectNone('testcases_for_product');selectAll('subgroup_testcases');return checkFormContents(this);">
<input id="mode" name="mode" type="hidden" value="edit">
<input id="editform_subgroup_id" name="editform_subgroup_id" type="hidden" value="">
<input id="product_persist" name="product_persist" type="hidden" value="" />
<input id="branch_persist" name="branch_persist" type="hidden" value="" />
<input id="testgroup_persist" name="testgroup_persist" type="hidden" value="" />
<table class="manage">
<tr>
<td class="headerleft">Subgroup ID#:</td>
<td name="subgroup_id_display" id="subgroup_id_display"></td>
<td name="subgroup_id_display_edit" id="subgroup_id_display_edit"></td>
</tr>
<tr>
<td class="headerleft">Name:</td>

Просмотреть файл

@ -32,6 +32,8 @@
<form id="edit_test_run_form" name="edit_test_run_form" method="post" action="manage_test_runs.cgi" onSubmit="selectNone('testgroups_for_product');selectAll('test_run_testgroups');return checkFormContents(this);">
<input id="mode" name="mode" type="hidden" value="edit">
<input id="editform_test_run_id" name="editform_test_run_id" type="hidden" value="">
<input id="product_persist" name="product_persist" type="hidden" value="" />
<input id="branch_persist" name="branch_persist" type="hidden" value="" />
<table class="manage">
<tr>

Просмотреть файл

@ -34,11 +34,15 @@
<form id="edit_testcase_form" name="edit_testcase_form" method="post" action="manage_testcases.cgi" onSubmit="return checkFormContents(this);">
<input id="mode" name="mode" type="hidden" value="edit">
<input id="editform_testcase_id" name="editform_testcase_id" type="hidden" value="">
<input id="product_persist" name="product_persist" type="hidden" value="" />
<input id="branch_persist" name="branch_persist" type="hidden" value="" />
<input id="testgroup_persist" name="testgroup_persist" type="hidden" value="" />
<input id="subgroup_persist" name="subgroup_persist" type="hidden" value="" />
<table class="manage">
<tr>
<td class="headerleft">Testcase ID#:</td>
<td name="testcase_id_display" id="testcase_id_display_edit"></td>
<td name="testcase_id_display_edit" id="testcase_id_display_edit"></td>
</tr>
<tr>
<td class="headerleft">Summary:</td>

Просмотреть файл

@ -32,6 +32,8 @@
<form id="edit_testgroup_form" name="edit_testgroup_form" method="post" action="manage_testgroups.cgi" onSubmit="selectNone('subgroups_for_product');selectAll('testgroup_subgroups');return checkFormContents(this);">
<input id="mode" name="mode" type="hidden" value="edit">
<input id="editform_testgroup_id" name="editform_testgroup_id" type="hidden" value="">
<input id="product_persist" name="product_persist" type="hidden" value="" />
<input id="branch_persist" name="branch_persist" type="hidden" value="" />
<table class="manage">
<tr>

Просмотреть файл

@ -62,13 +62,13 @@ var testcases=[% IF testcases_js %][% testcases_js %][% ELSE %]{}[% END %];
</tr>
<tr>
<td>
[% INCLUDE form_widgets/select_product_id.tmpl name="product_filter" placeholder=1 size=1 display_id=1 onchange="changeProduct('_filter');filterList();" %]
[% INCLUDE form_widgets/select_product_id.tmpl name="product_filter" placeholder=1 size=1 display_id=1 onchange="changeProduct('_filter');changeBranch('_filter');updatePersistVars();filterList();" %]
</td>
<td>
[% INCLUDE form_widgets/select_branch_id.tmpl name="branch_filter" placeholder=1 size=1 display_id=1 onchange="changeBranch('_filter');filterList();" %]
[% INCLUDE form_widgets/select_branch_id.tmpl name="branch_filter" placeholder=1 size=1 display_id=1 onchange="changeBranch('_filter');updatePersistVars();filterList();" %]
</td>
<td>
[% INCLUDE form_widgets/select_testgroup_id.tmpl name="testgroup_filter" placeholder=1 size=1 display_id=1 onchange="filterList();" %]
[% INCLUDE form_widgets/select_testgroup_id.tmpl name="testgroup_filter" placeholder=1 size=1 display_id=1 onchange="updatePersistVars();filterList();" %]
</td>
</tr>
</table>
@ -125,6 +125,19 @@ if (em.selectedIndex >= 0) {
} else {
disableForm('edit_subgroup_form');
}
var suffix='';
[% IF product_persist %]
setSelected(document.getElementById('product_filter'),[% product_persist | uri %]);
[% END %]
changeProduct('_filter');
[% IF branch_persist %]
setSelected(document.getElementById('branch_filter'),[% branch_persist | uri %]);
changeBranch('_filter');
[% IF testgroup_persist %]
setSelected(document.getElementById('testgroup_filter'),[% testgroup_persist | uri %]);
[% END %]
[% END %]
filterList();
</script>
[% INCLUDE global/litmus_footer.tmpl %]

Просмотреть файл

@ -61,10 +61,10 @@ var opsyses=[% IF opsyses_js %][% opsyses_js %][% ELSE %]{}[% END %];
</tr>
<tr>
<td>
[% INCLUDE form_widgets/select_product_id.tmpl name="product_filter" placeholder=1 size=1 display_id=1 onchange="suffix='_filter';changeProduct();filterList();" %]
[% INCLUDE form_widgets/select_product_id.tmpl name="product_filter" placeholder=1 size=1 display_id=1 onchange="changeProduct('_filter');updatePersistVars();filterList();" %]
</td>
<td>
[% INCLUDE form_widgets/select_branch_id.tmpl name="branch_filter" placeholder=1 size=1 display_id=1 onchange="filterList();" %]
[% INCLUDE form_widgets/select_branch_id.tmpl name="branch_filter" placeholder=1 size=1 display_id=1 onchange="updatePersistVars();filterList();" %]
</td>
</tr>
</table>
@ -119,10 +119,16 @@ if (em.selectedIndex >= 0) {
enableForm('edit_test_run_form');
} else {
disableForm('edit_test_run_form');
changeProduct();
}
var suffix='_filter';
changeProduct();filterList();
var suffix='';
[% IF product_persist %]
setSelected(document.getElementById('product_filter'),[% product_persist | uri %]);
[% END %]
changeProduct('_filter');
[% IF branch_persist %]
setSelected(document.getElementById('branch_filter'),[% branch_persist | uri %]);
[% END %]
filterList();
</script>

Просмотреть файл

@ -35,6 +35,7 @@ var products=[% IF products_js %][% products_js %][% ELSE %]{}[% END %];
var branches=[% IF branches_js %][% branches_js %][% ELSE %]{}[% END %];
var testgroups=[% IF testgroups_js %][% testgroups_js %][% ELSE %]{}[% END %];
var subgroups=[% IF subgroups_js %][% subgroups_js %][% ELSE %]{}[% END %];
var initial_subgroup=[% IF subgroup_persist %][% subgroup_persist %][% ELSE %]0[% END %];
</script>
<div id="page">
@ -62,16 +63,16 @@ var subgroups=[% IF subgroups_js %][% subgroups_js %][% ELSE %]{}[% END %];
</tr>
<tr>
<td>
[% INCLUDE form_widgets/select_product_id.tmpl name="product_filter" placeholder=1 size=1 display_id=1 onchange="changeProduct('_filter');filterList();" %]
[% INCLUDE form_widgets/select_product_id.tmpl name="product_filter" placeholder=1 size=1 display_id=1 onchange="changeProduct('_filter');changeBranch('_filter');changeTestgroup('_filter');updatePersistVars();filterList();" %]
</td>
<td>
[% INCLUDE form_widgets/select_branch_id.tmpl name="branch_filter" placeholder=1 size=1 display_id=1 onchange="changeBranch('_filter');filterList();" %]
[% INCLUDE form_widgets/select_branch_id.tmpl name="branch_filter" placeholder=1 size=1 display_id=1 onchange="changeBranch('_filter');changeTestgroup('_filter');updatePersistVars();filterList();" %]
</td>
<td>
[% INCLUDE form_widgets/select_testgroup_id.tmpl name="testgroup_filter" placeholder=1 size=1 display_id=1 onchange="subgroupBox=document.getElementById('subgroup_filter');changeTestgroup('_filter');filterList();" %]
[% INCLUDE form_widgets/select_testgroup_id.tmpl name="testgroup_filter" placeholder=1 size=1 display_id=1 onchange="subgroupBox=document.getElementById('subgroup_filter');changeTestgroup('_filter');updatePersistVars();filterList();" %]
</td>
<td>
[% INCLUDE form_widgets/select_subgroup_id.tmpl name="subgroup_filter" placeholder=1 size=1 display_id=1 onchange="filterList();" %]
[% INCLUDE form_widgets/select_subgroup_id.tmpl name="subgroup_filter" placeholder=1 size=1 display_id=1 onchange="updatePersistVars();filterList();" %]
</td>
</tr>
</table>
@ -135,6 +136,20 @@ if (em.selectedIndex >= 0) {
} else {
disableForm('edit_testcase_form');
}
var suffix='';
[% IF product_persist %]
setSelected(document.getElementById('product_filter'),[% product_persist | uri %]);
[% END %]
changeProduct('_filter');
[% IF branch_persist %]
setSelected(document.getElementById('branch_filter'),[% branch_persist | uri %]);
changeBranch('_filter');
[% IF testgroup_persist %]
setSelected(document.getElementById('testgroup_filter'),[% testgroup_persist | uri %]);
subgroupBox=document.getElementById('subgroup_filter');
changeTestgroupFirstPass('_filter');
[% END %]
[% END %]
</script>
[% INCLUDE global/litmus_footer.tmpl %]

Просмотреть файл

@ -60,10 +60,10 @@ var subgroups=[% IF subgroups_js %][% subgroups_js %][% ELSE %]{}[% END %];
</tr>
<tr>
<td>
[% INCLUDE form_widgets/select_product_id.tmpl name="product_filter" placeholder=1 size=1 display_id=1 onchange="changeProduct('_filter');filterList();" %]
[% INCLUDE form_widgets/select_product_id.tmpl name="product_filter" placeholder=1 size=1 display_id=1 onchange="changeProduct('_filter');updatePersistVars();filterList();" %]
</td>
<td>
[% INCLUDE form_widgets/select_branch_id.tmpl name="branch_filter" placeholder=1 size=1 display_id=1 onchange="filterList();" %]
[% INCLUDE form_widgets/select_branch_id.tmpl name="branch_filter" placeholder=1 size=1 display_id=1 onchange="updatePersistVars();filterList();" %]
</td>
</tr>
</table>
@ -121,6 +121,15 @@ if (em.selectedIndex >= 0) {
} else {
disableForm('edit_testgroup_form');
}
var suffix='';
[% IF product_persist %]
setSelected(document.getElementById('product_filter'),[% product_persist | uri %]);
[% END %]
changeProduct('_filter');
[% IF branch_persist %]
setSelected(document.getElementById('branch_filter'),[% branch_persist | uri %]);
[% END %]
filterList();
</script>
[% INCLUDE global/litmus_footer.tmpl %]

Просмотреть файл

@ -30,7 +30,8 @@
<a href="common_results.cgi?status=fail">Most&nbsp;Common Failures</a> | <a href="common_results.cgi?status=unclear">Testcases&nbsp;Most&nbsp;Frequently&nbsp;Marked&nbsp;As&nbsp;Unclear</a> |
<a href="aggregate_results.cgi"> Testgroup&nbsp;Popularity</a> | <a href="search_results.cgi?has_comments=1">Results&nbsp;with&nbsp;Comments</a><br/>
Search testcases: <a href="show_test.cgi?searchType=recent&amp;recently=added">Recently&nbsp;Added</a> |
<a href="show_test.cgi?searchType=recent&amp;recently=changed">Recently&nbsp;Changed</a>
<a href="show_test.cgi?searchType=recent&amp;recently=changed">Recently&nbsp;Changed</a>[% IF defaultemail && defaultemail.isInAdminGroup() %] |
<a href="show_test.cgi?searchType=ungrouped">Ungrouped</a>[% END %]
</div>
</div>

Просмотреть файл

@ -235,6 +235,10 @@ Use this to limit the number of results displayed.
<td class="heading">Display automated results?</td>
<td><input type="radio" id="automated" name="automated" value="1" />&nbsp;Automated Only <input type="radio" id="automated" name="automated" value="0E0" />&nbsp;Manual Only <input type="radio" id="automated" name="automated" value="all" checked />&nbsp;All</td>
</tr>
<tr>
<td class="heading">Associated bug(s)?</td>
<td><input type="radio" id="withbugs" name="withbugs" value="1" />&nbsp;With bug(s) <input type="radio" id="withbugs" name="withbugs" value="0E0" />&nbsp;No bug(s) <input type="radio" id="withbugs" name="withbugs" value="all" checked />&nbsp;All</td>
</tr>
</tr>
</table>
</div>

Просмотреть файл

@ -187,6 +187,19 @@ No bugs on file.
</div> <!--END section-full-->
<div class="section-full">
<div class="section-header">
Testcase #<a href="show_test.cgi?id=[% result.testcase_id | uri | html%]">[% result.testcase_id %]: [% result.testcase.summary | html %]</a>
</div>
<div class="section-content">
[% INCLUDE test/test.html.tmpl testcase=result.testcase show_config=0 print=1 %]
</div> <!--END section-content-->
</div> <!--END section-full-->
<div class="section-full">
<div class="section-header">
Comments

Просмотреть файл

@ -33,13 +33,12 @@
<tr>
[% IF fulltext %]<th width="5%">Relevance</th>[% END %]
<td class="headerleft">Testcase ID#: Summary</td>
<th>Creation Date</th>
<th>Last Updated</th>
</tr>
[% IF testcases.size==0 %]
<tr>
<td class="no-results" colspan="[% IF fulltext %]4[% ELSE %]3[% END %]">No matching testcases were found.</td>
<td class="no-results" colspan="[% IF fulltext %]3[% ELSE %]2[% END %]">No matching testcases were found.</td>
</tr>
[% ELSE %]
[% FOREACH testcase=testcases %]
@ -51,7 +50,6 @@
<tr class="[% rowstyle %]">
[% IF fulltext %]<td align="center">[% testcase.relevance | html | format('%.2f') %]</td>[% END %]
<td align="left"><a href="show_test.cgi?id=[% testcase.testcase_id | html | uri %]">[% testcase.testcase_id | html %]</a>: [% testcase.summary | html %]</td>
<td align="center">[% testcase.creation_date | html %]</td>
<td align="center">[% testcase.last_updated | html %]</td>
</tr>
[% END %]

Просмотреть файл

@ -3,7 +3,7 @@
<h3>Get Testing!</h3>
<ul>
<li><a href="run_tests.cgi">Run Tests</a></li>
<li><a href="show_test.cgi">View Tests</a></li>
<li><a href="show_test.cgi">View/Search Tests</a></li>
</ul>
</div>
</div>