b=314938,321116,321388,322949,350251,370211,370212

* test runs:
** update coverage stats dynamically when returning to run more tests
** replace index page with test run summary statistics
** provide more guidance to users after they submit test results
** considerable page load speed increases at entry points to testing by pushing stats calculations into AJAX which will load after the page loads
** basic test run reporting
This commit is contained in:
ccooper%deadsquid.com 2007-04-18 01:57:45 +00:00
Родитель fc74196d66
Коммит baf763b73d
69 изменённых файлов: 3478 добавлений и 1428 удалений

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

@ -111,8 +111,9 @@ ORDER by sg.name ASC
#########################################################################
sub coverage() {
my $self = shift;
my $platform = shift;
my $build_id = shift;
my $platform_id = shift;
my $opsys_id = shift;
my $locale = shift;
my $community_only = shift;
my $user = shift;
@ -140,7 +141,7 @@ sub coverage() {
if ($trusted) {
$sql .= ", users u";
}
$sql .= " WHERE tsg.subgroup_id=? AND tr.build_id=? AND tr.locale_abbrev=? AND o.platform_id=?";
$sql .= " WHERE tsg.subgroup_id=? AND tr.build_id=? AND tr.locale_abbrev=? AND o.platform_id=? AND o.opsys_id=?";
if ($community_only) {
$sql .= " AND t.community_enabled=1";
}
@ -158,7 +159,8 @@ sub coverage() {
$self->{'subgroup_id'},
$build_id,
$locale,
$platform->{'platform_id'}
$platform_id,
$opsys_id
);
my @test_results = $self->sth_to_objects($sth);

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

@ -20,7 +20,7 @@
# The Initial Developer of the Original Code is
# the Mozilla Corporation.
# Portions created by the Initial Developer are Copyright (C) 2006
# the Initial Developer. All Rights Reserved.
# the Initial Developetr. All Rights Reserved.
#
# Contributor(s):
# Chris Cooper <ccooper@deadsquid.com>
@ -35,28 +35,518 @@ package Litmus::DB::TestRun;
use strict;
use base 'Litmus::DBI';
use Time::Piece;
use Time::Seconds;
use Litmus::DB::Testgroup;
Litmus::DB::TestRun->table('test_runs');
Litmus::DB::TestRun->columns(All => qw/test_run_id testgroup_id name description start_timestamp finish_timestamp enabled/);
Litmus::DB::TestRun->columns(TEMP => qw//);
Litmus::DB::TestRun->columns(Primary => qw/test_run_id/);
Litmus::DB::TestRun->columns(All => qw/test_run_id name description start_timestamp finish_timestamp enabled recommended product_id branch_id creation_date last_updated author_id version/);
Litmus::DB::TestRun->columns(Essential => qw/test_run_id name description start_timestamp finish_timestamp enabled recommended product_id branch_id creation_date last_updated author_id version/);
Litmus::DB::TestRun->columns(TEMP => qw/testgroups/);
Litmus::DB::TestRun->columns(TEMP => qw/criteria/);
Litmus::DB::TestRun->column_alias("testgroup_id", "testgroup");
Litmus::DB::TestRun->column_alias("product_id", "product");
Litmus::DB::TestRun->column_alias("branch_id", "branch");
Litmus::DB::TestRun->column_alias("author_id", "author");
Litmus::DB::TestRun->has_a(testgroup => "Litmus::DB::Testgroup");
Litmus::DB::TestRun->has_many(subgroups =>
[ "Litmus::DB::SubgroupTestgroup" => "testgroup" ]);
Litmus::DB::TestRun->has_a(product => "Litmus::DB::Product");
Litmus::DB::TestRun->has_a(branch => "Litmus::DB::Branch");
Litmus::DB::TestRun->has_a(author => "Litmus::DB::User");
Litmus::DB::TestRun->autoinflate(dates => 'Time::Piece');
#########################################################################
sub getCriteria() {
my $self = shift;
my $dbh = __PACKAGE__->db_Main();
my $sql = "SELECT trc.build_id, trc.platform_id, trc.opsys_id,
pl.name AS platform_name, o.name AS opsys_name
FROM test_run_criteria trc
LEFT JOIN platforms pl ON trc.platform_id=pl.platform_id
LEFT JOIN opsyses o ON trc.opsys_id=o.opsys_id
WHERE trc.test_run_id=?";
my $sth = $dbh->prepare($sql);
$sth->execute($self->test_run_id);
my @criteria;
while (my $data = $sth->fetchrow_hashref) {
push @criteria, $data;
}
$sth->finish();
return \@criteria;
}
#########################################################################
sub getCriteriaSql() {
my $self = shift;
# Iterate over criteria
if (!$self->criteria) {
$self->criteria($self->getCriteria());
}
if ($self->criteria and scalar @{$self->criteria} > 0) {
my $criteria_sql .= " AND (";
foreach my $criterion (@{$self->criteria}) {
my $criterion_sql;
if ($criteria_sql ne " AND (") {
$criterion_sql = " OR (";
} else {
$criterion_sql = "(";
}
if ($criterion->{'build_id'}) {
$criterion_sql .= "tr.build_id=" . $criterion->{'build_id'};
}
# We can ignore platform if opsys is provided.
if ($criterion->{'opsys_id'}) {
$criterion_sql .= " AND " if ($criterion_sql ne '(');
$criterion_sql .= "tr.opsys_id=" . $criterion->{'opsys_id'};
} elsif ($criterion->{'platform_id'}) {
$criterion_sql .= " AND " if ($criterion_sql ne '(');
$criterion_sql .= "pl.platform_id=" . $criterion->{'platform_id'};
}
$criterion_sql .= ')';
$criteria_sql .= $criterion_sql;
}
$criteria_sql .= ')';
# print STDERR $criteria_sql;
return $criteria_sql;
}
return "";
}
#########################################################################
sub clone() {
my $self = shift;
my $new_test_run = $self->copy;
if (!$new_test_run) {
return undef;
}
my $dbh = __PACKAGE__->db_Main();
# Propagate testgroup membership;
my $sql = "INSERT INTO test_run_testgroups (test_run_id,testgroup_id,sort_order) SELECT ?,testgroup_id,sort_order FROM test_run_testgroups WHERE test_run_id=?";
my $rows = $dbh->do($sql,
undef,
$new_test_run->test_run_id,
$self->test_run_id
);
if (! $rows) {
print STDERR "Unable to clone test run membership for test run ID# " . $self->test_run_id . ' -> ' . $new_test_run->test_run_id . "\n";
}
# Propagate criteria.
$sql = "INSERT INTO test_run_criteria (test_run_id,build_id,platform_id,opsys_id) SELECT ?,build_id,platform_id,opsys_id FROM test_run_criteria WHERE test_run_id=?";
$rows = $dbh->do($sql,
undef,
$new_test_run->test_run_id,
$self->test_run_id
);
if (! $rows) {
print STDERR "Unable to clone test run criteria for test run ID# " . $self->test_run_id . ' -> ' . $new_test_run->test_run_id . "\n";
}
return $new_test_run;
}
#########################################################################
sub delete_testgroups() {
my $self = shift;
my $dbh = __PACKAGE__->db_Main();
my $sql = "DELETE from test_run_testgroups WHERE test_run_id=?";
my $rows = $dbh->do($sql,
undef,
$self->test_run_id
);
}
#########################################################################
sub delete_criteria() {
my $self = shift;
my $dbh = __PACKAGE__->db_Main();
my $sql = "DELETE from test_run_criteria WHERE test_run_id=?";
my $rows = $dbh->do($sql,
undef,
$self->test_run_id
);
}
#########################################################################
sub delete_with_refs() {
my $self = shift;
$self->delete_testgroups();
$self->delete_criteria();
return $self->delete;
}
#########################################################################
sub update_testgroups() {
my $self = shift;
my $new_testgroup_ids = shift;
# We always want to delete the existing testgroups.
# Failing to delete testgroups is _not_ fatal when adding a new test run.
my $rv = $self->delete_testgroups();
if (scalar @$new_testgroup_ids) {
my $dbh = __PACKAGE__->db_Main();
my $sql = "INSERT INTO test_run_testgroups (testgroup_id,test_run_id,sort_order) VALUES (?,?,?)";
my $sort_order = 1;
foreach my $new_testgroup_id (@$new_testgroup_ids) {
next if (!$new_testgroup_id);
# Log any failures/duplicate keys to STDERtr.
eval {
my $rows = $dbh->do($sql,
undef,
$new_testgroup_id,
$self->test_run_id,
$sort_order
);
};
if ($@) {
print STDERR $@;
}
$sort_order++;
}
}
}
#########################################################################
sub update_criteria() {
my $self = shift;
my $new_criteria = shift;
# We always want to delete the existing criteria.
# Failing to delete criteria is _not_ fatal when adding a new test run.
my $rv = $self->delete_criteria();
if (scalar @$new_criteria) {
my $dbh = __PACKAGE__->db_Main();
my $sql = "INSERT INTO test_run_criteria (test_run_id,build_id,platform_id,opsys_id) VALUES (?,?,?,?)";
foreach my $criterion (@$new_criteria) {
next if (!$criterion);
# Log any failures/duplicate keys to STDERtr.
eval {
my $rows = $dbh->do($sql,
undef,
$self->test_run_id,
$criterion->{'build_id'},
$criterion->{'platform_id'},
$criterion->{'opsys_id'}
);
};
if ($@) {
print STDERR $@;
}
}
}
}
#########################################################################
sub getTestRuns() {
my ($self, $in_progress, $recommended, $limit) = @_;
my $select = "SELECT test_run_id FROM test_runs";
my $where = "";
my $order_by = "";
if ($in_progress) {
$where = " WHERE start_timestamp<=NOW() AND finish_timestamp>NOW()";
}
if ($recommended and $recommended ne 'all') {
if ($where eq "") {
$where = ' WHERE';
} else {
$where .= ' AND';
}
if ($recommended eq 'true') {
$where .= ' recommended=1';
} else {
$where .= ' recommended=0';
}
$order_by = ' ORDER BY finish_timestamp ASC';
} else {
$order_by = ' ORDER BY recommended DESC, finish_timestamp ASC';
}
my $sql = $select . $where . $order_by;
if ($limit) {
$sql .= " LIMIT $limit";
}
my $dbh = __PACKAGE__->db_Main();
my $sth = $dbh->prepare($sql);
$sth->execute();
my @test_run_ids;
while (my ($test_run_id) = $sth->fetchrow_array) {
push @test_run_ids, $test_run_id;
}
$sth->finish();
my @test_runs;
foreach my $test_run_id (@test_run_ids) {
my $test_run = Litmus::DB::TestRun->getTestRunWithRefs($test_run_id);
push @test_runs, $test_run;
}
return @test_runs;
}
#########################################################################
sub coverage {
my $self = shift;
my $community_only = shift;
my $user = shift;
my $trusted = shift;
my @testcase_ids;
# Community members can only be expected to submit results for testcases
# than they have access to.
if ($community_only) {
@testcase_ids = Litmus::DB::Testcase->search_CommunityEnabledByTestRun($self->test_run_id);
} else {
@testcase_ids = Litmus::DB::Testcase->search_EnabledByTestRun($self->test_run_id);
}
my $sql = "
SELECT COUNT(DISTINCT(tr.testcase_id))
FROM test_runs trun, test_run_testgroups truntg, testgroups tg, subgroup_testgroups sgtg, subgroups sg, testcase_subgroups tcsg, testcases tc, test_results tr, opsyses o, platforms pl, users u
WHERE
trun.test_run_id=? AND
trun.test_run_id=truntg.test_run_id AND
truntg.testgroup_id=sgtg.testgroup_id AND
truntg.testgroup_id=tg.testgroup_id AND
sgtg.subgroup_id=tcsg.subgroup_id AND
sgtg.subgroup_id=sg.subgroup_id AND
tcsg.testcase_id=tc.testcase_id AND
tc.testcase_id=tr.testcase_id AND
tr.opsys_id=o.opsys_id AND
o.platform_id=pl.platform_id AND
tg.enabled=1 AND
sg.enabled=1 AND
tc.enabled=1 AND
tr.submission_time>=trun.start_timestamp AND
tr.submission_time<=trun.finish_timestamp AND
tr.branch_id=trun.branch_id AND
tr.user_id=u.user_id
";
if ($community_only) {
$sql .= " AND tc.community_enabled=1";
}
if ($user) {
$sql .= " AND tr.user_id=$user";
}
if ($trusted) {
$sql .= " AND u.is_admin=1";
}
$sql .= $self->getCriteriaSql();
my $dbh = __PACKAGE__->db_Main();
my $sth = $dbh->prepare($sql);
$sth->execute($self->test_run_id);
my ($num_testcases_with_results) = $sth->fetchrow_array;
$sth->finish();
if (scalar @testcase_ids <= 0) {
return undef;
}
my $coverage = sprintf("%d",100*$num_testcases_with_results/(scalar @testcase_ids));
return $coverage;
}
#########################################################################
sub getNumResultsByStatus {
my $self = shift;
my $status_id = shift;
my $community_only = shift;
my $user = shift;
my $trusted = shift;
my $sql = "
SELECT COUNT(DISTINCT(tr.testresult_id))
FROM test_runs trun, test_run_testgroups truntg, testgroups tg, subgroup_testgroups sgtg, subgroups sg, testcase_subgroups tcsg, testcases tc, test_results tr, opsyses o, platforms pl, users u
WHERE
trun.test_run_id=? AND
trun.test_run_id=truntg.test_run_id AND
truntg.testgroup_id=sgtg.testgroup_id AND
truntg.testgroup_id=tg.testgroup_id AND
sgtg.subgroup_id=tcsg.subgroup_id AND
sgtg.subgroup_id=sg.subgroup_id AND
tcsg.testcase_id=tc.testcase_id AND
tc.testcase_id=tr.testcase_id AND
tr.opsys_id=o.opsys_id AND
o.platform_id=pl.platform_id AND
tg.enabled=1 AND
sg.enabled=1 AND
tc.enabled=1 AND
tr.submission_time>=trun.start_timestamp AND
tr.submission_time<=trun.finish_timestamp AND
tr.branch_id=trun.branch_id AND
tr.user_id=u.user_id AND
tr.result_status_id=?
";
if ($community_only) {
$sql .= " AND tc.community_enabled=1";
}
if ($user) {
$sql .= " AND tr.user_id=$user";
}
if ($trusted) {
$sql .= " AND u.is_admin=1";
}
$sql .= $self->getCriteriaSql();
my $dbh = __PACKAGE__->db_Main();
my $sth = $dbh->prepare($sql);
$sth->execute($self->test_run_id,$status_id);
my ($num_results) = $sth->fetchrow_array;
$sth->finish();
return $num_results;
}
#########################################################################
sub getNumResultsWithComments {
my $self = shift;
my $community_only = shift;
my $user = shift;
my $trusted = shift;
my $sql = "
SELECT COUNT(DISTINCT(tr.testresult_id))
FROM test_runs trun, test_run_testgroups trtg, testgroups tg, subgroup_testgroups sgtg, subgroups sg, testcase_subgroups tcsg, testcases tc, test_results tr INNER JOIN test_result_comments trc ON tr.testresult_id=trc.test_result_id, opsyses o, platforms pl, users u
WHERE
trun.test_run_id=? AND
trun.test_run_id=trtg.test_run_id AND
trtg.testgroup_id=sgtg.testgroup_id AND
trtg.testgroup_id=tg.testgroup_id AND
sgtg.subgroup_id=tcsg.subgroup_id AND
sgtg.subgroup_id=sg.subgroup_id AND
tcsg.testcase_id=tc.testcase_id AND
tc.testcase_id=tr.testcase_id AND
tr.opsys_id=o.opsys_id AND
o.platform_id=pl.platform_id AND
tg.enabled=1 AND
sg.enabled=1 AND
tc.enabled=1 AND
tr.submission_time>=trun.start_timestamp AND
tr.submission_time<=trun.finish_timestamp AND
tr.branch_id=trun.branch_id AND
tr.user_id=u.user_id
";
if ($community_only) {
$sql .= " AND tc.community_enabled=1";
}
if ($user) {
$sql .= " AND tr.user_id=$user";
}
if ($trusted) {
$sql .= " AND u.is_admin=1";
}
$sql .= $self->getCriteriaSql();
my $dbh = __PACKAGE__->db_Main();
my $sth = $dbh->prepare($sql);
$sth->execute($self->test_run_id);
my ($num_results) = $sth->fetchrow_array;
$sth->finish();
return $num_results;
}
#########################################################################
sub getTestRunWithRefs {
my $self = shift;
my $test_run_id = shift;
my $test_run = Litmus::DB::TestRun->retrieve($test_run_id);
if ($test_run) {
my @testgroups = Litmus::DB::Testgroup->search_ByTestRun($test_run->{'test_run_id'});
$test_run->{'testgroups'} = \@testgroups;
my $criteria = $test_run->getCriteria();
$test_run->{'criteria'} = $criteria;
}
return $test_run;
}
#########################################################################
sub flagCriteriaInUse() {
my $self = shift;
my $sysconfig = shift;
my $opsys = Litmus::DB::Opsys->retrieve($sysconfig->{'opsys_id'});
if ($self->criteria and scalar(@{$self->criteria}) > 0) {
foreach my $criterion (@{$self->criteria}) {
# Build ID alone is the smallest possible criteria set.
if ($criterion->{'build_id'} == $sysconfig->{'build_id'}) {
if ($criterion->{'platform_id'}) {
if ($criterion->{'platform_id'} == $sysconfig->{'platform_id'}) {
if ($criterion->{'opsys_id'}) {
if ($criterion->{'opsys_id'} == $sysconfig->{'opsys_id'}) {
# Matches build ID, platform ID, and opsys ID
$criterion->{'in_use'} = 1;
last;
}
next;
}
# Matches build ID and platform ID
$criterion->{'in_use'} = 1;
$criterion->{'opsys_id'} = $sysconfig->{'opsys_id'};
$criterion->{'opsys_name'} = $opsys->name;
$criterion->{'opsys_id_from_user'} = 1;
last;
}
next;
}
# Matches build ID.
$criterion->{'in_use'} = 1;
$criterion->{'platform_id'} = $sysconfig->{'platform_id'};
$criterion->{'platform_name'} = $opsys->platform->name;
$criterion->{'platform_id_from_user'} = 1;
$criterion->{'opsys_id'} = $sysconfig->{'opsys_id'};
$criterion->{'opsys_name'} = $opsys->name;
$criterion->{'opsys_id_from_user'} = 1;
last;
}
}
} else {
# No criteria associated with this test run, so any complete set of
# criteria will do.
my $criterion;
$criterion->{'in_use'} = 1;
$criterion->{'build_id'} = $sysconfig->{'build_id'};
$criterion->{'build_id_from_user'} = 1;
$criterion->{'platform_id'} = $sysconfig->{'platform_id'};
$criterion->{'platform_name'} = $opsys->platform->name;
$criterion->{'platform_id_from_user'} = 1;
$criterion->{'opsys_id'} = $sysconfig->{'opsys_id'};
$criterion->{'opsys_name'} = $opsys->name;
$criterion->{'opsys_id_from_user'} = 1;
push @{$self->{'criteria'}}, $criterion;
}
}
1;

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

@ -144,14 +144,14 @@ WHERE
});
#########################################################################
# is_completed($$$$$)
# isCompleted($$$$$)
#
# Check whether we have test results for the current test that correspond
# to the provided platform, build_id, and user(optional).
#########################################################################
sub is_completed {
sub isCompleted {
my $self = shift;
my $platform = shift;
my $opsys_id = shift;
my $build_id = shift;
my $locale = shift;
my $user = shift; # optional
@ -162,29 +162,85 @@ sub is_completed {
@results = Litmus::DB::Testresult->search_CompletedByTrusted(
$self->{'testcase_id'},
$build_id,
$locale->{'abbrev'},
$platform->{'platform_id'},
$locale,
$opsys_id,
);
} elsif ($user) {
@results = Litmus::DB::Testresult->search_CompletedByUser(
$self->{'testcase_id'},
$build_id,
$locale->{'abbrev'},
$platform->{'platform_id'},
$locale,
$opsys_id,
$user->{'user_id'},
);
} else {
@results = Litmus::DB::Testresult->search_Completed(
$self->{'testcase_id'},
$build_id,
$locale->{'abbrev'},
$platform->{'platform_id'},
$locale,
$opsys_id,
);
}
return @results;
}
sub coverage() {
my $self = shift;
my $build_id = shift;
my $platform_id = shift;
my $opsys_id = shift;
my $locale = shift;
my $user = shift; # optional
my $trusted = shift; # optional
# print STDERR "b:$build_id p:$platform_id o:$opsys_id l:$locale u:$user t:$trusted\n";
# Propagate subgroup membership;
my $dbh = __PACKAGE__->db_Main();
my $select = "SELECT tr.testresult_id, trsl.class_name";
my $from = " FROM test_results tr, users u, opsyses o, test_result_status_lookup trsl";
my $where = " WHERE tr.testcase_id=" . quotemeta($self->{'testcase_id'}) . " AND tr.user_id=u.user_id AND tr.opsys_id=o.opsys_id AND tr.result_status_id=trsl.result_status_id";
my $order_by = " ORDER BY tr.submission_time DESC";
if ($build_id) {
$where .= " AND tr.build_id=" . quotemeta($build_id);
}
if ($platform_id) {
$where .= " AND o.platform_id=" . quotemeta($platform_id);
}
if ($opsys_id) {
$where .= " AND tr.opsys_id=" . quotemeta($opsys_id);
}
if ($locale) {
$where .= " AND tr.locale_abbrev='" . quotemeta($locale) . "'";
}
if ($user) {
$where .= " AND tr.user_id=" . quotemeta($user->{'user_id'});
}
if ($trusted) {
$where .= " AND u.is_admin=1";
}
my $sql = $select . $from . $where . $order_by;
# print $sql,"<br/>\n";
my $sth = $dbh->prepare_cached($sql);
$sth->execute();
my @test_results;
while (my ($result_id, $class_name) = $sth->fetchrow_array) {
my $hash_ref;
$hash_ref->{'result_id'} = $result_id;
$hash_ref->{'status'} = $class_name;
push @test_results, $hash_ref;
}
$sth->finish;
if (scalar(@test_results) == 0) {
return undef;
}
return \@test_results;
}
#########################################################################
sub getFullTextMatches() {
my $self = shift;

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

@ -48,46 +48,69 @@ Litmus::DB::Testgroup->has_a(product => "Litmus::DB::Product");
Litmus::DB::Testgroup->has_a(branch => "Litmus::DB::Branch");
__PACKAGE__->set_sql(EnabledByBranch => qq{
SELECT tg.*
FROM testgroups tg
WHERE tg.branch_id=? AND tg.enabled=1 ORDER by tg.name ASC
SELECT tg.*
FROM testgroups tg
WHERE tg.branch_id=? AND tg.enabled=1
ORDER by tg.name ASC
});
__PACKAGE__->set_sql(ByBranch => qq{
SELECT tg.*
FROM testgroups tg
WHERE tg.branch_id=? ORDER by tg.name ASC
SELECT tg.*
FROM testgroups tg
WHERE tg.branch_id=?
ORDER by tg.name ASC
});
__PACKAGE__->set_sql(EnabledBySubgroup => qq{
SELECT tg.*
FROM testgroups tg, subgroup_testgroups sgtg
WHERE sgtg.subgroup_id=? AND sgtg.testgroup_id=tg.testgroup_id AND tg.enabled=1 ORDER by tg.name ASC
SELECT tg.*
FROM testgroups tg, subgroup_testgroups sgtg
WHERE sgtg.subgroup_id=? AND sgtg.testgroup_id=tg.testgroup_id AND tg.enabled=1
ORDER by tg.name ASC
});
__PACKAGE__->set_sql(BySubgroup => qq{
SELECT tg.*
FROM testgroups tg, subgroup_testgroups sgtg
WHERE sgtg.subgroup_id=? AND sgtg.testgroup_id=tg.testgroup_id ORDER by tg.name ASC
SELECT tg.*
FROM testgroups tg, subgroup_testgroups sgtg
WHERE sgtg.subgroup_id=? AND sgtg.testgroup_id=tg.testgroup_id
ORDER by tg.name ASC
});
__PACKAGE__->set_sql(EnabledByTestcase => qq{
SELECT tg.*
FROM testgroups tg, subgroup_testgroups sgtg, testcase_subgroups tcsg
WHERE tcsg.testcase_id=? AND tcsg.subgroup_id=sgtg.subgroup_id AND sgtg.testgroup_id=tg.testgroup_id AND tg.enabled=1 ORDER by tg.name ASC
SELECT tg.*
FROM testgroups tg, subgroup_testgroups sgtg, testcase_subgroups tcsg
WHERE tcsg.testcase_id=? AND tcsg.subgroup_id=sgtg.subgroup_id AND sgtg.testgroup_id=tg.testgroup_id AND tg.enabled=1
ORDER by tg.name ASC
});
__PACKAGE__->set_sql(ByTestcase => qq{
SELECT tg.*
FROM testgroups tg, subgroup_testgroups sgtg, testcase_subgroups tcsg
WHERE tcsg.testcase_id=? AND tcsg.subgroup_id=sgtg.subgroup_id AND sgtg.testgroup_id=tg.testgroup_id ORDER by tg.name ASC
SELECT tg.*
FROM testgroups tg, subgroup_testgroups sgtg, testcase_subgroups tcsg
WHERE tcsg.testcase_id=? AND tcsg.subgroup_id=sgtg.subgroup_id AND sgtg.testgroup_id=tg.testgroup_id
ORDER by tg.name ASC
});
__PACKAGE__->set_sql(ByTestRun => qq{
SELECT tg.*
FROM testgroups tg, test_run_testgroups trtg
WHERE trtg.test_run_id=? AND trtg.testgroup_id=tg.testgroup_id
ORDER by tg.name ASC
});
__PACKAGE__->set_sql(EnabledByTestRun => qq{
SELECT tg.*
FROM testgroups tg, test_run_testgroups trtg
WHERE trtg.test_run_id=? AND
trtg.testgroup_id=tg.testgroup_id AND
tg.enabled=1
ORDER by tg.name ASC
});
#########################################################################
sub coverage {
my $self = shift;
my $platform = shift;
my $build_id = shift;
my $platform_id = shift;
my $opsys_id = shift;
my $locale = shift;
my $community_only = shift;
my $user = shift;
@ -99,8 +122,9 @@ sub coverage {
my $num_empty_subgroups = 0;
foreach my $subgroup (@subgroups) {
my $subgroup_percent = $subgroup->coverage(
$platform,
$build_id,
$platform_id,
$opsys_id,
$locale,
$community_only,
$user,
@ -141,7 +165,7 @@ sub clone() {
$self->testgroup_id
);
if (! $rows) {
# XXX: Do we need to throw a warning here?
print STDERR "Unable to clone testgroup membership for testgroup ID# " . $self->testgroup_id . ' -> ' . $new_testgroup->testgroup_id . "\n";
}
return $new_testgroup;

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

@ -36,8 +36,6 @@ use strict;
require Exporter;
use Litmus;
use Litmus::DB::Locale;
use Litmus::DB::Product;
use Litmus::Error;
use Litmus::Utils;
use CGI;
@ -45,20 +43,26 @@ use CGI;
our @ISA = qw(Exporter);
our @EXPORT = qw();
my $configcookiename = $Litmus::Config::sysconfig_cookiename;
my $cookie_prefix = $Litmus::Config::sysconfig_cookiename . '_sysconfig_test_run_id_';
sub new {
my ($class, $product, $platform, $opsys, $branch, $build_id, $locale) = @_;
my ($test_run_id, $build_id, $platform_id, $opsys_id, $locale) = @_;
my $self = {};
bless($self);
$self->{"product"} = $product;
$self->{"platform"} = $platform;
$self->{"opsys"} = $opsys;
$self->{"branch"} = $branch;
$self->{"build_id"} = $build_id;
$self->{"locale"} = $locale;
$self->{"test_run_id"} = $test_run_id;
$self->{"build_id"} = $build_id;
$self->{"platform_id"} = $platform_id;
$self->{"opsys_id"} = $opsys_id;
$self->{"locale"} = $locale;
$self->{"id"} = join('|',
$test_run_id,
$build_id || '',
$platform_id || '',
$opsys_id || '',
$locale || ''
);
return $self;
}
@ -66,13 +70,16 @@ sub new {
sub setCookie {
my $self = shift;
my %cookiedata;
my $c = Litmus->cgi();
my $cookie = $c->cookie(
-name => $configcookiename.'_'.$self->{"product"}->product_id(),
-value => join('|', $self->{"product"}->product_id(), $self->{"platform"}->platform_id(),
$self->{"opsys"}->opsys_id(), $self->{"branch"}->branch_id(), $self->{"build_id"}, $self->{"locale"}->abbrev()),
-name => $cookie_prefix . $self->{"test_run_id"},
-value => join('|',
$self->{"test_run_id"},
$self->{"build_id"},
$self->{"platform_id"},
$self->{"opsys_id"},
$self->{"locale"}
),
-domain => $main::ENV{"HTTP_HOST"},
);
@ -81,182 +88,64 @@ sub setCookie {
sub getCookie {
my $self = shift;
my $cookie_name = shift;
my $c = Litmus->cgi();
my $product = shift;
return Litmus::SysConfig->
realGetCookie($configcookiename.'_'.$product->product_id());
}
# returns sysconfig objects corresponding to all sysconfig cookies the user
# has set
sub getAllCookies {
my $self = shift;
my $c = Litmus->cgi();
my @cookies = ();
my @names = $c->cookie();
foreach my $cur (@names) {
if ($cur =~ /^\Q$configcookiename\E_/) {
push(@cookies, Litmus::SysConfig->realGetCookie($cur));
}
}
if (@cookies == 0) { push(@cookies, undef) }
return @cookies;
}
sub realGetCookie {
my $self = shift;
my $cookiename = shift;
my $c = Litmus->cgi();
my $cookie = $c->cookie($cookiename);
if (! $cookie) {
my $cookie = $c->cookie($cookie_name);
if (! $cookie) {
return;
}
my @sysconfig = split(/\|/, $cookie);
return new(undef,
Litmus::DB::Product->retrieve($sysconfig[0]),
Litmus::DB::Platform->retrieve($sysconfig[1]),
Litmus::DB::Opsys->retrieve($sysconfig[2]),
Litmus::DB::Branch->retrieve($sysconfig[3]),
$sysconfig[4],
Litmus::DB::Locale->retrieve($sysconfig[5])
);
return new($sysconfig[0],
$sysconfig[1],
$sysconfig[2],
$sysconfig[3],
$sysconfig[4]
);
}
sub product() {
sub getCookieByTestRunId {
my $self = shift;
my $test_run_id = shift;
return $self->{"product"};
}
sub platform() {
my $self = shift;
return $self->{"platform"};
}
sub opsys() {
my $self = shift;
return $self->{"opsys"};
}
sub branch() {
my $self = shift;
return $self->{"branch"};
}
sub build_id() {
my $self = shift;
return $self->{"build_id"};
}
sub locale() {
my $self = shift;
return $self->{"locale"};
}
# display the system configuration form
# optionally takes the product to configure for
# and requires a url to load when done. this
# url should call processForm() to
# set the sysconfig cookie and do
# error handling.
# optionaly, pass a CGI object and its
# data will be stored in the form so
# the receiving script can access it.
sub displayForm {
my $self = shift;
my $product = shift;
my $goto = shift;
my $c = shift;
my @products;
# if we already know the product, then just send it on:
if ($product) {
$products[0] = $product;
} else {
# we need to ask the user for the product then
@products = Litmus::DB::Product->retrieve_all();
my $c = Litmus->cgi();
my $cookie = $c->cookie($cookie_prefix . $test_run_id);
if (! $cookie) {
return;
}
my @locales = Litmus::DB::Locale->retrieve_all(
{ order_by => 'abbrev' }
);
my $vars = {
locales => \@locales,
products => \@products,
ua => Litmus::UserAgentDetect->new(),
"goto" => $goto,
cgidata => $c,
};
my @sysconfig = split(/\|/, $cookie);
# if the user already has a cookie set for this product, then
# load those values as defaults:
if ($product && Litmus::SysConfig->getCookie($product)) {
my $sysconfig = Litmus::SysConfig->getCookie($product);
$vars->{"defaultplatform"} = $sysconfig->platform();
$vars->{"defaultopsys"} = $sysconfig->opsys();
$vars->{"defaultbranch"} = $sysconfig->branch();
$vars->{"defaultlocale"} = $sysconfig->locale();
}
# send a default build id if we have one:
my @cookies = Litmus::SysConfig->getAllCookies();
if ($cookies[0]) { $vars->{"defaultbuildid"} = $cookies[0]->build_id() }
my $cookie = Litmus::Auth::getCurrentUser();
$vars->{"defaultemail"} = $cookie;
$vars->{"show_admin"} = Litmus::Auth::istrusted($cookie);
$vars->{"title"} = "Run Tests";
Litmus->template()->process("runtests/sysconfig.html.tmpl", $vars) ||
internalError(Litmus->template()->error());
return new($sysconfig[0],
$sysconfig[1],
$sysconfig[2],
$sysconfig[3],
$sysconfig[4]
);
}
# process a form containing sysconfig information.
# takes a CGI object containing param data
sub processForm {
# returns sysconfig objects corresponding to all sysconfig cookies the user
# has set
sub getAllCookies {
my $self = shift;
my $c = shift;
my $c = Litmus->cgi();
my $product = Litmus::DB::Product->retrieve($c->param("product"));
my $platform = Litmus::DB::Platform->retrieve($c->param("platform"));
my $opsys = Litmus::DB::Opsys->retrieve($c->param("opsys"));
my $branch = Litmus::DB::Branch->retrieve($c->param("branch"));
my $build_id = $c->param("build_id");
my $locale = Litmus::DB::Locale->retrieve($c->param("locale"));
requireField("product", $product);
requireField("platform", $platform);
requireField("opsys", $opsys);
requireField("branch", $branch);
requireField("build_id", $build_id);
requireField("locale", $locale);
# set a cookie with the user's testing details:
my $prod = Litmus::DB::Product->retrieve($c->param("product"));
my $sysconfig = Litmus::SysConfig->new(
$product,
$platform,
$opsys,
$branch,
$build_id,
$locale
);
return $sysconfig;
my @cookies = ();
my @names = $c->cookie();
foreach my $cur (@names) {
if ($cur =~ /^${cookie_prefix}/) {
push(@cookies, Litmus::SysConfig->getCookie($cur));
}
}
if (@cookies == 0) {
push(@cookies, undef)
}
return @cookies;
}
1;

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

@ -30,58 +30,45 @@
use strict;
$|++;
#use Time::HiRes qw( gettimeofday tv_interval );
#my $t0 = [gettimeofday];
my $t0;
if ($Litmus::Config::DEBUG) {
use Time::HiRes qw( gettimeofday tv_interval );
$t0 = [gettimeofday];
}
use Litmus;
use Litmus::Auth;
use Litmus::Error;
use Litmus::DB::Testresult;
use Litmus::FormWidget;
use Time::Piece::MySQL;
use Litmus::DB::TestRun;
Litmus->init();
my ($criteria,$results) = Litmus::DB::Testresult->getDefaultTestResults;
my $products = Litmus::FormWidget->getProducts();
my $platforms = Litmus::FormWidget->getUniquePlatforms();
my $test_groups = Litmus::FormWidget->getTestgroups();
my $result_statuses = Litmus::FormWidget->getResultStatuses;
my $branches = Litmus::FormWidget->getBranches();
my $c = Litmus->cgi();
print $c->header();
my $vars = {
title => 'Main Page',
products => $products,
platforms => $platforms,
test_groups => $test_groups,
result_statuses => $result_statuses,
branches => $branches,
limit => $Litmus::DB::Testresult::_num_results_default,
title => 'Active Test Runs',
};
# Only include results if we have them.
if ($results and scalar @$results > 0) {
$vars->{results} = $results;
my @test_runs = Litmus::DB::TestRun->getTestRuns(1,'all',5);
if (@test_runs and scalar @test_runs > 0) {
$vars->{'active_test_runs'} = \@test_runs;
}
my $user = Litmus::Auth::getCurrentUser();
if ($user) {
$vars->{"defaultemail"} = $user;
$vars->{"show_admin"} = $user->is_admin();
$vars->{"defaultemail"} = $user;
$vars->{"show_admin"} = $user->is_admin();
}
Litmus->template()->process("index.tmpl", $vars) ||
internalError(Litmus->template()->error());
#my $elapsed = tv_interval ( $t0 );
#printf "<div id='pageload'>Page took %f seconds to load.</div>", $elapsed;
if ($Litmus::Config::DEBUG) {
my $elapsed = tv_interval ( $t0 );
printf "<div id='pageload'>Page took %f seconds to load.</div>", $elapsed;
}
exit 0;

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

@ -2,15 +2,16 @@ var subgroup;
var filter_req;
var showAll = function(err) {
// if they cancelled, then just don't change anything:
if (err instanceof CancelledError) { return }
toggleMessage('none');
// if they cancelled, then just don't change anything:
if (err instanceof CancelledError) { return }
toggleMessage('none');
var testbox = document.getElementById("subgroup_id");
for (var i=0; i<testbox.options.length; i++) {
var option = testbox.options[i];
option.style.display = '';
}
var testbox = document.getElementById("subgroup_id");
for (var i=0; i<testbox.options.length; i++) {
var option = testbox.options[i];
option.style.display = '';
}
enableForm(formName);
};
var doFilterList = function(req) {
@ -24,6 +25,7 @@ for (var i=0; i<subgroupbox.options.length; i++) {
hide == 1 ? subgroup.style.display = 'none' : subgroup.style.display = '';
}
toggleMessage('none');
enableForm(formName);
};
// filter the list by various criteria:
@ -32,11 +34,14 @@ function filterList() {
if (filter_req instanceof Deferred && filter_req.fired == -1)
filter_req.cancel();
disableForm(formName);
var productfilter = document.getElementById('product_filter');
var branchfilter = document.getElementById('branch_filter');
var testgroupfilter = document.getElementById('testgroup_filter');
if (productfilter.options[productfilter.selectedIndex].value == '---' &&
testgroupfilter.options[testgroupfilter.selectedIndex].value == '---') {
if (productfilter.options[productfilter.selectedIndex].value == '' &&
branchfilter.options[branchfilter.selectedIndex].value == '' &&
testgroupfilter.options[testgroupfilter.selectedIndex].value == '') {
// nothing to do here
showAll();
return;
@ -45,9 +50,11 @@ function filterList() {
toggleMessage('loading','Filtering subgroup list...');
filter_req = doSimpleXMLHttpRequest('manage_subgroups.cgi', {
searchSubgroupList: 1,
product: (productfilter.options[productfilter.selectedIndex].value == '---' ?
product: (productfilter.options[productfilter.selectedIndex].value == '' ?
'' : productfilter.options[productfilter.selectedIndex].value),
testgroup: (testgroupfilter.options[testgroupfilter.selectedIndex].value == '---' ?
branch: (branchfilter.options[branchfilter.selectedIndex].value == '' ?
'' : branchfilter.options[branchfilter.selectedIndex].value),
testgroup: (testgroupfilter.options[testgroupfilter.selectedIndex].value == '' ?
'' : testgroupfilter.options[testgroupfilter.selectedIndex].value)
});
// if something went wrong, just show all the tests:
@ -92,44 +99,37 @@ function loadSubgroup(silent) {
function populateSubgroup(data) {
subgroup=data;
document.getElementById('editform_subgroup_id').value = subgroup.subgroup_id;
document.getElementById('editform_subgroup_id_display').innerHTML = subgroup.subgroup_id;
document.getElementById('editform_name').value = subgroup.name;
document.getElementById('name_text').innerHTML = subgroup.name;
document.getElementById('subgroup_id_display').innerHTML = subgroup.subgroup_id;
var productBox = document.getElementById('editform_product');
var options = productBox.getElementsByTagName('option');
var found_product = 0;
for (var i=0; i<options.length; i++) {
if (options[i].value == subgroup.product_id.product_id) {
options[i].selected = true;
document.getElementById('product_text').innerHTML = options[i].text;
found_product=1;
} else {
options[i].selected = false;
document.getElementById('editform_subgroup_id').value = subgroup.subgroup_id;
document.getElementById('subgroup_id_display').innerHTML = subgroup.subgroup_id;
document.getElementById('name').value = subgroup.name;
document.getElementById('name_text').innerHTML = subgroup.name;
var productBox = document.getElementById('product');
var found_product = setSelected(productBox,subgroup.product_id.product_id);
if (found_product == 1) {
for (var i=0; i<products.length; i++) {
if (products[i].product_id == subgroup.product_id.product_id) {
document.getElementById('product_text').innerHTML = products[i].name;
continue;
}
}
}
if (found_product == 0 && options) {
options[0].selected = true;
} else {
document.getElementById('product_text').innerHTML = '<em>No product set for this subgroup.</em>';
}
changeProduct();
populateBranches(productBox);
var branchBox = document.getElementById('editform_branch');
var options = branchBox.getElementsByTagName('option');
var found_branch = 0;
for (var i=0; i<options.length; i++) {
if (options[i].value == subgroup.branch_id.branch_id) {
options[i].selected = true;
document.getElementById('branch_text').innerHTML = options[i].text;
found_branch=1;
} else {
options[i].selected = false;
var branchBox = document.getElementById('branch');
populateBranches(branchBox,productBox);
var found_branch = setSelected(branchBox,subgroup.branch_id.branch_id);
if (found_branch == 1) {
for (var i=0; i<branches.length; i++) {
if (branches[i].branch_id == subgroup.branch_id.branch_id) {
document.getElementById('branch_text').innerHTML = branches[i].name;
continue;
}
}
}
if (found_branch == 0) {
} else {
document.getElementById('branch_text').innerHTML = '<em>No branch set for this subgroup.</em>';
options[0].selected = true;
}
var testgroups_text = "";
var testgroups_link_text = "";
@ -149,17 +149,17 @@ function populateSubgroup(data) {
document.getElementById('testgroups_link_display').innerHTML = '<span class="errorHeading">This subgroup does not belong to any testgroups that are currently enabled &rArr;&nbsp;<a target="manage_testgroups" href="manage_testgroups.cgi">Jump to Manage Testgroups</a>.</span>';
}
var enabled_em = document.getElementById('editform_enabled')
var enabled_em = document.getElementById('enabled')
if (subgroup.enabled == 1) {
enabled_em.checked = true;
} else {
enabled_em.checked = false;
}
document.getElementById('editform_testrunner_group_id').innerHTML = subgroup.testrunner_group_id;
document.getElementById('testrunner_group_id').innerHTML = subgroup.testrunner_group_id;
populateAllTestcases();
var selectBoxSubgroup = document.getElementById('editform_subgroup_testcases');
var selectBoxSubgroup = document.getElementById('subgroup_testcases');
selectBoxSubgroup.options.length = 0;
for (var i=0; i<subgroup.testcases.length; i++) {
var optionText = subgroup.testcases[i].testcase_id + ': ' + subgroup.testcases[i].summary;
@ -174,19 +174,19 @@ function populateSubgroup(data) {
function blankSubgroupForm(formid) {
blankForm(formid);
document.getElementById('editform_subgroup_id_display').innerHTML = '';
var selectBoxAll = document.getElementById('editform_testcases_for_product');
document.getElementById('subgroup_id_display').innerHTML = '';
var selectBoxAll = document.getElementById('testcases_for_product');
selectBoxAll.options.length = 0;
selectBoxAll.options[selectBoxAll.length] = new Option("--No product selected--",
selectBoxAll.options[selectBoxAll.length] = new Option("-No product selected-",
"");
selectBoxAll.selectedIndex=-1;
var selectBoxSubgroup = document.getElementById('editform_subgroup_testcases');
var selectBoxSubgroup = document.getElementById('subgroup_testcases');
selectBoxSubgroup.options.length = 0;
selectBoxSubgroup.options[selectBoxSubgroup.length] = new Option("--No subgroup selected--",
selectBoxSubgroup.options[selectBoxSubgroup.length] = new Option("-No subgroup selected-",
"");
selectBoxSubgroup.selectedIndex=-1;
document.getElementById('editform_testrunner_group_id').innerHTML = '';
document.getElementById('testrunner_group_id').innerHTML = '';
changeProduct();
changeTestgroup();
@ -195,57 +195,28 @@ function blankSubgroupForm(formid) {
function switchToAdd() {
disableModeButtons();
blankSubgroupForm('edit_subgroup_form');
document.getElementById('editform_subgroup_id_display').innerHTML = '<em>Automatically generated for a new subgroup</em>';
document.getElementById('subgroup_id_display').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('editform_testrunner_group_id').innerHTML = '<em>Not Applicable</em>';
document.getElementById('editform_submit').value = 'Add Subgroup';
document.getElementById('editform_mode').value = 'add';
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';
document.getElementById('editform_div').style.display = 'block';
}
function switchToEdit() {
document.getElementById('editform_submit').value = 'Submit Edits';
document.getElementById('editform_mode').value = 'edit';
document.getElementById('submit').value = 'Submit Edits';
document.getElementById('mode').value = 'edit';
enableForm('edit_subgroup_form');
document.getElementById('subgroup_display_div').style.display = 'none';
document.getElementById('editform_div').style.display = 'block';
}
function populateBranches(productBox) {
var branchBox = document.getElementById('editform_branch');
branchBox.options.length = 0;
var productId = productBox.options[productBox.selectedIndex].value;
var product = getProductById(productId);
if (!product) {
// no product set
var option = new Option('-No product selected-','');
branchBox.add(option, null);
return;
}
var option = new Option('-Branch-','');
branchBox.add(option, null);
var branches = product['branches'];
for (var i=0; i<branches.length; i++) {
var option = new Option(branches[i].name,branches[i].id);
option.selected = false;
if (subgroup &&
subgroup.product_id &&
productId == subgroup.product_id.product_id) {
if (option.value == subgroup.branch_id) {
option.selected = true;
}
}
branchBox.add(option, null);
}
}
function populateAllTestcases() {
var productBox = document.getElementById('editform_product');
var branchBox = document.getElementById('editform_branch');
var selectBoxAll = document.getElementById('editform_testcases_for_product');
var productBox = document.getElementById('product');
var branchBox = document.getElementById('branch');
var selectBoxAll = document.getElementById('testcases_for_product');
selectBoxAll.options.length = 0;
for (var i in testcases) {
if (testcases[i].product_id != productBox.options[productBox.selectedIndex].value) {
@ -280,9 +251,9 @@ function resetSubgroup() {
function checkFormContents(f) {
return (
checkString(f.editform_name, 'Name') &&
verifySelected(f.editform_product, 'Product') &&
verifySelected(f.editform_branch, 'Branch')
checkString(f.name, 'Name') &&
verifySelected(f.product, 'Product') &&
verifySelected(f.branch, 'Branch')
);
}

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

@ -0,0 +1,421 @@
var test_run;
var filter_req;
var showAllTestRuns = function(err) {
// if they cancelled, then just don't change anything:
if (err instanceof CancelledError) { return }
toggleMessage('none');
var testbox = document.getElementById("test_run_id");
for (var i=0; i<testbox.options.length; i++) {
var option = testbox.options[i];
option.style.display = '';
}
enableForm(formName);
};
var doFilterList = function(req) {
var tests = req.responseText.split("\n");
var testbox = document.getElementById("test_run_id");
var testsVisible = 0;
for (var i=1; i<testbox.options.length; i++) {
var test = testbox.options[i];
var hideTest = 0;
var id = test.value;
if (tests.indexOf(id) == -1) {
hideTest = 1;
}
hideTest == 1 ? test.style.display = 'none' : test.style.display = '';
if (test.style.display != 'none') {
testsVisible = 1;
}
}
if (testsVisible) {
testbox.options[0].text = '-Test Run (ID#)-';
} else {
testbox.options[0].text = '-No matching Test Runs found-';
}
toggleMessage('none');
enableForm(formName);
};
// filter the list by various criteria:
function filterList() {
// they just changed the selection, so cancel any pending filter actions:
if (filter_req instanceof Deferred && filter_req.fired == -1)
filter_req.cancel();
disableForm(formName);
var productfilter = document.getElementById('product_filter');
var branchfilter = document.getElementById('branch_filter');
if (productfilter.options[productfilter.selectedIndex].value == '' &&
branchfilter.options[branchfilter.selectedIndex].value == '') {
// nothing to do here
showAllTestRuns();
return;
}
toggleMessage('loading','Filtering Test Run list...');
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),
});
// if something went wrong, just show all the tests:
filter_req.addErrback(showAllTestRuns);
filter_req.addCallback(doFilterList);
}
function setAuthor(user_id) {
var authorBox = document.getElementById('author_id');
setSelected(authorBox,user_id);;
}
function enableModeButtons() {
document.getElementById("edit_test_run_button").disabled=false;
document.getElementById("clone_test_run_button").disabled=false;
document.getElementById("delete_test_run_button").disabled=false;
}
function disableModeButtons() {
document.getElementById("edit_test_run_button").disabled=true;
document.getElementById("clone_test_run_button").disabled=true;
document.getElementById("delete_test_run_button").disabled=true;
}
function loadTestRun(silent) {
var test_run_select = document.getElementById("test_run_id");
if (! test_run_select ||
test_run_select.options[test_run_select.selectedIndex].value=="") {
disableModeButtons();
document.getElementById('test_run_display_div').style.display = 'none';
document.getElementById('editform_div').style.display = 'none';
disableForm('edit_test_run_form');
blankTestRunForm('edit_test_run_form');
return false;
}
var test_run_id = test_run_select.options[test_run_select.selectedIndex].value;
disableForm('edit_test_run_form');
if (!silent) {
toggleMessage('loading','Loading Test Run ID# ' + test_run_id + '...');
}
var url = 'json.cgi?test_run_id=' + test_run_id;
fetchJSON(url,populateTestRun,silent);
}
function populateTestRun(data) {
test_run=data;
document.getElementById('editform_test_run_id').value = test_run.test_run_id;
document.getElementById('test_run_id_display').innerHTML = test_run.test_run_id;
document.getElementById('name').value = test_run.name;
document.getElementById('name_text').innerHTML = test_run.name;
document.getElementById('description').value = test_run.description;
if (test_run.description != '') {
document.getElementById('desc_text').innerHTML = test_run.description;
} else {
document.getElementById('desc_text').innerHTML = '<em>No description provided.</em>';
}
document.getElementById('start_timestamp').value = test_run.start_timestamp.replace(/-| |:/g, "");
document.getElementById('start_timestamp_text').innerHTML = test_run.start_timestamp;
document.getElementById('finish_timestamp').value = test_run.finish_timestamp.replace(/-| |:/g, "");
document.getElementById('finish_timestamp_text').innerHTML = test_run.finish_timestamp;
var productBox = document.getElementById('product');
var found_product = setSelected(productBox,test_run.product_id.product_id);
if (found_product) {
for (var i=0; i<products.length; i++) {
if (test_run.product_id.product_id == products[i].product_id) {
document.getElementById('product_text').innerHTML = products[i].name;
continue;
}
}
}
changeProduct();
var branchBox = document.getElementById('branch');
populateBranches(branchBox,productBox);
var found_branch = setSelected(branchBox,test_run.branch_id.branch_id);
if (found_branch == 1) {
for (var i=0; i<branches.length; i++) {
if (test_run.branch_id.branch_id == branches[i].branch_id) {
document.getElementById('branch_text').innerHTML = branches[i].name;
continue;
}
}
} else {
document.getElementById('branch_text').innerHTML = '<em>No branch set for this Test Run.</em>';
}
populateAllTestgroups();
var selectBoxTestgroups = document.getElementById('test_run_testgroups');
selectBoxTestgroups.options.length = 0;
for (var i=0; i<test_run.testgroups.length; i++) {
var optionText = test_run.testgroups[i].name + ' (' + test_run.testgroups[i].testgroup_id + ')';
selectBoxTestgroups.options[selectBoxTestgroups.length] = new Option(optionText,
test_run.testgroups[i].testgroup_id);
}
setAuthor(test_run.author_id.user_id);
var enabled_em = document.getElementById('enabled')
var enabled_display_em = document.getElementById('enabled_display')
if (test_run.enabled == 1) {
enabled_em.checked = true;
enabled_display_em.checked = true;
} else {
enabled_em.checked = false;
enabled_display_em.checked = false;
}
var recommended_em = document.getElementById('recommended')
var recommended_display_em = document.getElementById('recommended_display')
if (test_run.recommended == 1) {
recommended_em.checked = true;
recommended_display_em.checked = true;
} else {
recommended_em.checked = false;
recommended_display_em.checked = false;
}
document.getElementById('creation_date').innerHTML = test_run.creation_date;
document.getElementById('last_updated').innerHTML = test_run.last_updated;
document.getElementById('version').innerHTML = test_run.version;
resetTable('tblNewCriteria');
if (!test_run.criteria ||
test_run.criteria.length == 0) {
addRowToTable('tblNewCriteria');
} else {
for (var i=0; i<test_run.criteria.length; i++) {
addRowToTable('tblNewCriteria',
test_run.criteria[i].build_id,
test_run.criteria[i].platform_id,
test_run.criteria[i].opsys_id
);
}
}
document.getElementById('editform_div').style.display = 'none';
document.getElementById('test_run_display_div').style.display = 'block';
enableModeButtons();
}
function populateAllTestgroups() {
toggleMessage('loading','Narrowing Testgroup List...');
try {
var productBox = document.getElementById('product');
var branchBox = document.getElementById('branch');
var selectBoxAll = document.getElementById('testgroups_for_product');
selectBoxAll.options.length = 0;
for (var i in testgroups) {
if (testgroups[i].product_id != productBox.options[productBox.selectedIndex].value) {
continue;
}
if (branchBox.selectedIndex >= 0) {
var found_branch = 0;
for (var j=0; j<branchBox.options.length; j++) {
if (branchBox.options[j].value == '' ||
branchBox.options[j].selected == false) {
continue;
}
if (testgroups[i].branch_id == branchBox.options[j].value) {
found_branch = 1;
}
}
if (found_branch == 0) {
continue;
}
}
var optionText = testgroups[i].name + ' (' + testgroups[i].testgroup_id + ')';
selectBoxAll.options[selectBoxAll.length] = new Option(optionText,
testgroups[i].testgroup_id);
}
if (selectBoxAll.options.length == 0) {
selectBoxAll.options[selectBoxAll.length] = new Option('-No Product/Branch selected-','');
}
} catch (e) {
// And do what exactly?
}
toggleMessage('none');
}
function blankTestRunForm(formid) {
blankForm(formid);
resetTable('tblNewCriteria');
addRowToTable('tblNewCriteria');
document.getElementById('test_run_id_display').innerHTML = '';
var selectBoxAll = document.getElementById('testgroups_for_product');
selectBoxAll.options.length = 0;
selectBoxAll.options[selectBoxAll.length] = new Option("-No Product/Branch Selected-",
"");
selectBoxAll.selectedIndex=-1;
var selectBoxTestgroups = document.getElementById('test_run_testgroups');
selectBoxTestgroups.options.length = 0;
selectBoxTestgroups.options[selectBoxTestgroups.length] = new Option("-No Test Run selected-","");
selectBoxTestgroups.selectedIndex=-1;
document.getElementById('enabled').checked = false;
document.getElementById('recommended').checked = false;
test_run = new Object();
changeProduct();
var productBox = document.getElementById('product');
var branchBox = document.getElementById('branch');
populateBranches(branchBox,productBox);
populateAllTestgroups();
}
function switchToAdd() {
disableModeButtons();
blankTestRunForm('edit_test_run_form');
var autoText = '<em>Automatically generated for a new Test Run</em>';
document.getElementById('test_run_id_display').innerHTML = autoText;
setAuthor(current_user_id);
document.getElementById('creation_date').innerHTML = autoText;
document.getElementById('last_updated').innerHTML = autoText;
document.getElementById('version').innerHTML = autoText;
document.getElementById('submit').value = 'Add Test Run';
document.getElementById('mode').value = 'add';
enableForm('edit_test_run_form');
document.getElementById('test_run_display_div').style.display = 'none';
document.getElementById('editform_div').style.display = 'block';
}
function switchToEdit() {
document.getElementById('submit').value = 'Submit Edits';
document.getElementById('mode').value = 'edit';
enableForm('edit_test_run_form');
document.getElementById('test_run_display_div').style.display = 'none';
document.getElementById('editform_div').style.display = 'block';
}
function resetTestRun() {
if (document.getElementById('test_run_id').value != '') {
populateTestRun(test_run);
switchToEdit();
} else {
switchToAdd();
}
}
function addRowToTable(tblName,buildID,platformID,opsysID) {
var tbl = document.getElementById(tblName);
var lastRow = tbl.rows.length;
// if there's no header row in the table, then iteration = lastRow + 1
var iteration = lastRow;
var row = tbl.insertRow(lastRow);
// Build ID cell
var cellBuildID = row.insertCell(0);
var el = document.createElement('input');
el.setAttribute('type', 'text');
el.setAttribute('name', 'build_id_new_' + iteration);
el.setAttribute('id', 'build_id_new_' + iteration);
el.setAttribute('size', '10');
if (buildID) {
el.setAttribute('value', buildID);
}
el.onchange = new Function("if (!checkBuildId(this,true)) { this.value = ''; this.focus(); }");
cellBuildID.appendChild(el);
// Platform cell
var cellPlatform = row.insertCell(1);
var el = document.createElement('select');
el.setAttribute('name', 'platform_new_' + iteration);
el.setAttribute('id', 'platform_new_' + iteration);
el.setAttribute('size', '1');
el.setAttribute('onChange', "changePlatform('_new_"+iteration+"')");
el.setAttribute('class', 'select_platform');
el.options[0] = new Option('-Platform (ID#)-','');
for(i=0;i<platforms.length;i+=1) {
el.options[i+1] = new Option(platforms[i].name+' ('+platforms[i].platform_id+')',platforms[i].platform_id);
}
cellPlatform.appendChild(el);
// Opsys cell
var cellOpsys = row.insertCell(2);
var el = document.createElement('select');
el.setAttribute('name', 'opsys_new_' + iteration);
el.setAttribute('id', 'opsys_new_' + iteration);
el.setAttribute('size', '1');
el.setAttribute('class', 'select_opsys');
el.options[0] = new Option('-Operating System (ID#)-','');
cellOpsys.appendChild(el);
if (platformID) {
var platformBox = document.getElementById('platform_new_' + iteration);
setSelected(platformBox,platformID);;
changePlatform('_new_'+iteration);
}
if (opsysID) {
var opsysBox = document.getElementById('opsys_new_' + iteration);
setSelected(opsysBox,opsysID);;
}
var cellRemoveButton = row.insertCell(3);
var el = document.createElement('input');
el.setAttribute('type', 'button');
el.setAttribute('name', 'remove_row_new_' + iteration);
el.setAttribute('id', 'remove_row_new_' + iteration);
el.setAttribute('class', 'button');
el.setAttribute('onClick', "removeRowFromTable('"+tblName+"');");
el.setAttribute('value', '-');
cellRemoveButton.appendChild(el);
var cellAddButton = row.insertCell(4);
var el = document.createElement('input');
el.setAttribute('type', 'button');
el.setAttribute('name', 'add_row_new_' + iteration);
el.setAttribute('id', 'add_row_new_' + iteration);
el.setAttribute('class', 'button');
el.setAttribute('onClick', "addRowToTable('"+tblName+"');");
el.setAttribute('value', '+');
cellAddButton.appendChild(el);
}
function removeRowFromTable(tblName) {
var tbl = document.getElementById(tblName);
var lastRow = tbl.rows.length;
if (lastRow > 2) tbl.deleteRow(lastRow - 1);
}
function resetTable(tblName) {
var tbl = document.getElementById(tblName);
var lastRow = tbl.rows.length;
while (tbl.rows.length > 1) {
tbl.deleteRow(tbl.rows.length - 1);
}
}
function checkFormContents(f) {
if ( checkString(f.name, 'Name') &&
verifySelected(f.product, 'Product') &&
verifySelected(f.branch, 'Branch') &&
checkTimestamp(f.start_timestamp, 'Start Timestamp') &&
checkTimestamp(f.finish_timestamp, 'Finish Timestamp') &&
verifySelected(f.author_id, 'Author')) {
// Verify that at least one testgroup is selected if this test run is
// going to be enabled.
if (f.enabled.checked) {
return verifySelectNotEmpty(f.test_run_testgroups,"In order to enable a Test Run, at least one testgroup must be selected.");
}
return true;
}
return false;
}

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

@ -2,33 +2,35 @@ var testcase;
var filter_req;
var showAllTests = function(err) {
// if they cancelled, then just don't change anything:
if (err instanceof CancelledError) { return }
toggleMessage('none');
// if they cancelled, then just don't change anything:
if (err instanceof CancelledError) { return }
toggleMessage('none');
var testbox = document.getElementById("testcase_id");
for (var i=0; i<testbox.options.length; i++) {
var option = testbox.options[i];
option.style.display = '';
}
var testbox = document.getElementById("testcase_id");
for (var i=0; i<testbox.options.length; i++) {
var option = testbox.options[i];
option.style.display = '';
}
enableForm(formName);
};
function splitIt(it) {
return it.split("\n");
return it.split("\n");
}
var doFilterList = function(req) {
var tests = splitIt(req.responseText);
var testbox = document.getElementById("testcase_id");
var l = testbox.options.length;
var hideTest;
for (var i=0; i<l; i++) {
var test = testbox.options[i];
if (tests.indexOf(test.value) == -1) { hideTest = 1; }
else { hideTest=0 }
hideTest == 1 ? test.style.display = 'none' : test.style.display = '';
}
toggleMessage('none');
var tests = splitIt(req.responseText);
var testbox = document.getElementById("testcase_id");
var l = testbox.options.length;
var hideTest;
for (var i=0; i<l; i++) {
var test = testbox.options[i];
if (tests.indexOf(test.value) == -1) { hideTest = 1; }
else { hideTest=0 }
hideTest == 1 ? test.style.display = 'none' : test.style.display = '';
}
enableForm(formName);
toggleMessage('none');
};
// filter the list by various criteria:
@ -37,11 +39,15 @@ function filterList() {
if (filter_req instanceof Deferred && filter_req.fired == -1)
filter_req.cancel();
disableForm(formName);
var productfilter = document.getElementById('product_filter');
var branchfilter = document.getElementById('branch_filter');
var testgroupfilter = document.getElementById('testgroup_filter');
var subgroupfilter = document.getElementById('subgroup_filter');
if (productfilter.options[productfilter.selectedIndex].value == '' &&
branchfilter.options[branchfilter.selectedIndex].value == '' &&
testgroupfilter.options[testgroupfilter.selectedIndex].value == '' &&
subgroupfilter.options[subgroupfilter.selectedIndex].value == '') {
// nothing to do here
@ -52,11 +58,13 @@ function filterList() {
toggleMessage('loading','Filtering testcase list...');
filter_req = doSimpleXMLHttpRequest('manage_testcases.cgi', {
searchTestcaseList: 1,
product: (productfilter.options[productfilter.selectedIndex].value == '---' ?
product: (productfilter.options[productfilter.selectedIndex].value == '' ?
'' : productfilter.options[productfilter.selectedIndex].value),
testgroup: (testgroupfilter.options[testgroupfilter.selectedIndex].value == '---' ?
branch: (branchfilter.options[branchfilter.selectedIndex].value == '' ?
'' : branchfilter.options[branchfilter.selectedIndex].value),
testgroup: (testgroupfilter.options[testgroupfilter.selectedIndex].value == '' ?
'' : testgroupfilter.options[testgroupfilter.selectedIndex].value),
subgroup: (subgroupfilter.options[subgroupfilter.selectedIndex].value == '---' ?
subgroup: (subgroupfilter.options[subgroupfilter.selectedIndex].value == '' ?
'' : subgroupfilter.options[subgroupfilter.selectedIndex].value),
});
// if something went wrong, just show all the tests:
@ -65,7 +73,8 @@ function filterList() {
}
function setAuthor(user_id) {
changeSelectedValue('editform_author_id',user_id);;
var authorBox = document.getElementById('author_id');
setSelected(authorBox,user_id);;
}
function enableModeButtons() {
@ -80,35 +89,6 @@ function disableModeButtons() {
document.getElementById("delete_testcase_button").disabled=true;
}
function populateBranches(productBox) {
var branchBox = document.getElementById('editform_branch');
branchBox.options.length = 0;
var productId = productBox.options[productBox.selectedIndex].value;
var product = getProductById(productId);
if (!product) {
// no product set
var option = new Option('-No product selected-','');
branchBox.add(option, null);
return;
}
var option = new Option('-Branch-','');
branchBox.add(option, null);
var branches = product['branches'];
for (var i=0; i<branches.length; i++) {
var option = new Option(branches[i].name,branches[i].id);
option.selected = false;
if (testcase &&
testcase.product_id &&
productId == testcase.product_id.product_id) {
if (option.value == testcase.branch_id) {
option.selected = true;
}
}
branchBox.add(option, null);
}
}
function loadTestcase(silent) {
var testcase_select = document.getElementById("testcase_id");
@ -135,47 +115,42 @@ function loadTestcase(silent) {
function populateTestcase(data) {
testcase=data;
document.getElementById('editform_testcase_id').value = testcase.testcase_id;
document.getElementById('editform_testcase_id_display').innerHTML = testcase.testcase_id;
document.getElementById('editform_summary').value = testcase.summary;
document.getElementById('editform_steps').value = testcase.steps;
document.getElementById('editform_results').value = testcase.expected_results;
document.getElementById('testcase_id_display').innerHTML = testcase.testcase_id;
document.getElementById('summary').value = testcase.summary;
document.getElementById('steps').value = testcase.steps;
document.getElementById('results').value = testcase.expected_results;
document.getElementById('summary_text').innerHTML = testcase.summary;
document.getElementById('steps_text').innerHTML = testcase.steps_formatted;
document.getElementById('results_text').innerHTML = testcase.expected_results_formatted;
var productBox = document.getElementById('editform_product');
var options = productBox.getElementsByTagName('option');
var found_product = 0;
for (var i=0; i<options.length; i++) {
if (options[i].value == testcase.product_id.product_id) {
options[i].selected = true;
document.getElementById('product_text').innerHTML = options[i].text;
found_product=1;
} else {
options[i].selected = false;
var productBox = document.getElementById('product');
loadProducts(productBox,'',1);
var found_product = setSelected(productBox,testcase.product_id.product_id);
if (found_product == 1) {
for (var i=0; i<products.length; i++) {
if (products[i].product_id == testcase.product_id.product_id) {
document.getElementById('product_text').innerHTML = products[i].name;
continue;
}
}
} else {
document.getElementById('product_text').innerHTML = '<em>No product set for this testcase.</em>';
}
if (found_product == 0 && options[0]) {
options[0].selected = true;
}
changeProduct();
populateBranches(productBox);
var branchBox = document.getElementById('editform_branch');
var options = branchBox.getElementsByTagName('option');
var found_branch = 0;
for (var i=0; i<options.length; i++) {
if (options[i].value == testcase.branch_id.branch_id) {
options[i].selected = true;
document.getElementById('branch_text').innerHTML = options[i].text;
found_branch=1;
} else {
options[i].selected = false;
var branchBox = document.getElementById('branch');
populateBranches(branchBox,productBox);
var found_branch = setSelected(branchBox,testcase.branch_id.branch_id);
if (found_branch == 1) {
for (var i=0; i<branches.length; i++) {
if (branches[i].branch_id == testcase.branch_id.branch_id) {
document.getElementById('branch_text').innerHTML = branches[i].name;
continue;
}
}
}
if (found_branch == 0) {
document.getElementById('branch_text').innerHTML = '<em>No branch set for this testcase.</em>';
options[0].selected = true;
} else {
document.getElementById('branch_text').innerHTML = '<em>No branch set for this subgroup.</em>';
}
var testgroups_text = "";
@ -215,7 +190,7 @@ function populateTestcase(data) {
document.getElementById('subgroups_link_display').innerHTML = '<span class="errorHeading">This testcase does not belong to any subgroups that are currently enabled &rArr;&nbsp;<a target="manage_subgroups" href="manage_subgroups.cgi">Jump to Manage Subgroups</a>.</span>';
}
var enabled_em = document.getElementById('editform_enabled')
var enabled_em = document.getElementById('enabled')
var enabled_display_em = document.getElementById('enabled_display')
if (testcase.enabled == 1) {
enabled_em.checked = true;
@ -224,7 +199,7 @@ function populateTestcase(data) {
enabled_em.checked = false;
enabled_display_em.checked = false;
}
var communityenabled_em = document.getElementById('editform_communityenabled')
var communityenabled_em = document.getElementById('communityenabled')
var communityenabled_display_em = document.getElementById('community_enabled_display')
if (testcase.community_enabled == 1) {
communityenabled_em.checked = true;
@ -235,17 +210,17 @@ function populateTestcase(data) {
}
if (testcase.regression_bug_id) {
document.getElementById('regression_bug_id_display').innerHTML = '<a href="' + generateBugLink(testcase.regression_bug_id) + '">' + testcase.regression_bug_id + '</a>';
document.getElementById('editform_regression_bug_id').value = testcase.regression_bug_id;
document.getElementById('regression_bug_id').value = testcase.regression_bug_id;
} else {
document.getElementById('regression_bug_id_display').innerHTML = 'None specified';
document.getElementById('editform_regression_bug_id').value = "";
document.getElementById('regression_bug_id').value = "";
}
setAuthor(testcase.author_id.user_id);
document.getElementById('editform_creation_date').innerHTML = testcase.creation_date;
document.getElementById('editform_last_updated').innerHTML = testcase.last_updated;
document.getElementById('editform_litmus_version').innerHTML = testcase.version;
document.getElementById('editform_testrunner_case_id').innerHTML = testcase.testrunner_case_id;
document.getElementById('editform_testrunner_case_version').innerHTML = testcase.testrunner_case_version;
document.getElementById('creation_date').innerHTML = testcase.creation_date;
document.getElementById('last_updated').innerHTML = testcase.last_updated;
document.getElementById('litmus_version').innerHTML = testcase.version;
document.getElementById('testrunner_case_id').innerHTML = testcase.testrunner_case_id;
document.getElementById('testrunner_case_version').innerHTML = testcase.testrunner_case_version;
document.getElementById('editform_div').style.display = 'none';
document.getElementById('testcase_display_div').style.display = 'block';
@ -259,44 +234,47 @@ function populateTestcase(data) {
function blankTestcaseForm(formid) {
blankForm(formid);
document.getElementById('editform_testcase_id_display').innerHTML = '';
document.getElementById('editform_creation_date').innerHTML = '';
document.getElementById('editform_last_updated').innerHTML = '';
document.getElementById('editform_litmus_version').innerHTML = '';
document.getElementById('editform_testrunner_case_id').innerHTML = '';
document.getElementById('editform_testrunner_case_version').innerHTML = '';
document.getElementById('testcase_id_display').innerHTML = '';
document.getElementById('creation_date').innerHTML = '';
document.getElementById('last_updated').innerHTML = '';
document.getElementById('litmus_version').innerHTML = '';
document.getElementById('testrunner_case_id').innerHTML = '';
document.getElementById('testrunner_case_version').innerHTML = '';
changeProduct();
}
function switchToAdd() {
disableModeButtons();
blankTestcaseForm('edit_testcase_form');
var productBox = document.getElementById('product');
loadProducts(productBox,'',1);
changeProduct();
setAuthor(current_user_id);
document.getElementById('editform_submit').value = 'Add Testcase';
document.getElementById('editform_mode').value = 'add';
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('editform_testcase_id_display').innerHTML = '<em>Automatically generated for a new testcase</em>';
document.getElementById('testcase_id_display').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('editform_creation_date').innerHTML = '<em>Automatically generated for a new testcase</em>';
document.getElementById('editform_last_updated').innerHTML = '<em>Automatically generated for a new testcase</em>';
document.getElementById('editform_litmus_version').innerHTML = '<em>Automatically generated for a new testcase</em>';
document.getElementById('editform_testrunner_case_id').innerHTML = '<em>Not Applicable</em>';
document.getElementById('editform_testrunner_case_version').innerHTML = '<em>Not Applicable</em>';
document.getElementById('creation_date').innerHTML = '<em>Automatically generated for a new testcase</em>';
document.getElementById('last_updated').innerHTML = '<em>Automatically generated for a new testcase</em>';
document.getElementById('litmus_version').innerHTML = '<em>Automatically generated for a new testcase</em>';
document.getElementById('testrunner_case_id').innerHTML = '<em>Not Applicable</em>';
document.getElementById('testrunner_case_version').innerHTML = '<em>Not Applicable</em>';
document.getElementById('editform_div').style.display = 'block';
}
function switchToEdit() {
document.getElementById('editform_submit').value = 'Submit Edits';
document.getElementById('editform_mode').value = 'edit';
document.getElementById('submit').value = 'Submit Edits';
document.getElementById('mode').value = 'edit';
enableForm('edit_testcase_form');
document.getElementById('testcase_display_div').style.display = 'none';
document.getElementById('editform_div').style.display = 'block';
}
function resetTestcase() {
if (document.getElementById('editform_testcase_id').value != '') {
if (document.getElementById('testcase_id').value != '') {
populateTestcase(testcase);
switchToEdit();
} else {
@ -306,13 +284,14 @@ function resetTestcase() {
function checkFormContents(f) {
return (
checkString(f.editform_summary, 'Summary') &&
verifySelected(f.editform_product, 'Product') &&
verifySelected(f.editform_branch, 'Branch') &&
verifySelected(f.editform_author_id, 'Author')
checkString(f.summary, 'Summary') &&
verifySelected(f.product, 'Product') &&
verifySelected(f.branch, 'Branch') &&
verifySelected(f.author_id, 'Author')
);
}
function generateBugLink(bugID) {
return 'https://bugzilla.mozilla.org?show_bug.cgi?id=' + bugID;
}

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

@ -11,6 +11,7 @@ var showAll = function(err) {
var option = testgroupbox.options[i];
option.style.display = '';
}
enableForm(formName);
};
var doFilterList = function(req) {
@ -24,6 +25,7 @@ var doFilterList = function(req) {
hide == 1 ? testgroup.style.display = 'none' : testgroup.style.display = '';
}
toggleMessage('none');
enableForm(formName);
};
// filter the list by various criteria:
@ -32,9 +34,13 @@ function filterList() {
if (filter_req instanceof Deferred && filter_req.fired == -1)
filter_req.cancel();
var productfilter = document.getElementById('product_filter');
disableForm(formName);
if (productfilter.options[productfilter.selectedIndex].value == '') {
var productfilter = document.getElementById('product_filter');
var branchfilter = document.getElementById('branch_filter');
if (branchfilter.options[branchfilter.selectedIndex].value == '' &&
productfilter.options[productfilter.selectedIndex].value == '') {
// nothing to do here
showAll();
return;
@ -43,7 +49,8 @@ function filterList() {
toggleMessage('loading','Filtering testgroup list...');
filter_req = doSimpleXMLHttpRequest('manage_testgroups.cgi', {
searchTestgroupList: 1,
product: (productfilter.options[productfilter.selectedIndex].value == '' ? '' : productfilter.options[productfilter.selectedIndex].value)
product: (productfilter.options[productfilter.selectedIndex].value == '' ? '' : productfilter.options[productfilter.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);
@ -85,89 +92,51 @@ function loadTestgroup(silent) {
fetchJSON(url,populateTestgroup,silent);
}
function populateBranches(productBox) {
var branchBox = document.getElementById('editform_branch');
branchBox.options.length = 0;
var productId = productBox.options[productBox.selectedIndex].value;
var product = getProductById(productId);
if (!product) {
// no product set
var option = new Option('-No product selected-','');
branchBox.add(option, null);
return;
}
var option = new Option('-Branch-','');
branchBox.add(option, null);
var branches = product['branches'];
for (var i=0; i<branches.length; i++) {
var option = new Option(branches[i].name,branches[i].id);
option.selected = false;
if (testgroup &&
testgroup.product_id &&
productId == testgroup.product_id.product_id) {
if (option.value == testgroup.branch_id) {
option.selected = true;
}
}
branchBox.add(option, null);
}
}
function populateTestgroup(data) {
testgroup=data;
document.getElementById('editform_testgroup_id').value = testgroup.testgroup_id;
document.getElementById('editform_testgroup_id_display').innerHTML = testgroup.testgroup_id;
document.getElementById('editform_name').value = testgroup.name;
document.getElementById('name_text').innerHTML = testgroup.name;
document.getElementById('testgroup_id_display').innerHTML = testgroup.testgroup_id;
document.getElementById('name').value = testgroup.name;
document.getElementById('name_text').innerHTML = testgroup.name;
var productBox = document.getElementById('editform_product');
var options = productBox.getElementsByTagName('option');
var found_product = 0;
for (var i=0; i<options.length; i++) {
if (options[i].value == testgroup.product_id.product_id) {
options[i].selected = true;
document.getElementById('product_text').innerHTML = options[i].text;
found_product=1;
} else {
options[i].selected = false;
var productBox = document.getElementById('product');
var found_product = setSelected(productBox,testgroup.product_id.product_id);
if (found_product == 1) {
for (var i=0; i<products.length; i++) {
if (products[i].product_id == testgroup.product_id.product_id) {
document.getElementById('product_text').innerHTML = products[i].name;
continue;
}
}
}
if (found_product == 0) {
document.getElementById('product_text').innerHTML = '<em>No product set for this testgroup.</em>';
options[0].selected = true;
} else {
document.getElementById('product_text').innerHTML = '<em>No product set for this testgroup.</em>';
}
changeProduct();
populateBranches(productBox);
var branchBox = document.getElementById('editform_branch');
var options = branchBox.getElementsByTagName('option');
var found_branch = 0;
for (var i=0; i<options.length; i++) {
if (options[i].value == testgroup.branch_id.branch_id) {
options[i].selected = true;
document.getElementById('branch_text').innerHTML = options[i].text;
found_branch=1;
} else {
options[i].selected = false;
var branchBox = document.getElementById('branch');
populateBranches(branchBox,productBox);
var found_branch = setSelected(branchBox,testgroup.branch_id.branch_id);
if (found_branch == 1) {
for (var i=0; i<branches.length; i++) {
if (branches[i].branch_id == testgroup.branch_id.branch_id) {
document.getElementById('branch_text').innerHTML = branches[i].name;
continue;
}
}
}
if (found_branch == 0) {
} else {
document.getElementById('branch_text').innerHTML = '<em>No branch set for this testgroup.</em>';
options[0].selected = true;
}
var enabled_em = document.getElementById('editform_enabled')
var enabled_em = document.getElementById('enabled')
if (testgroup.enabled == 1) {
enabled_em.checked = true;
} else {
enabled_em.checked = false;
}
document.getElementById('editform_testrunner_plan_id').innerHTML = testgroup.testrunner_plan_id;
document.getElementById('testrunner_plan_id').innerHTML = testgroup.testrunner_plan_id;
populateAllSubgroups();
var selectBoxTestgroup = document.getElementById('editform_testgroup_subgroups');
var selectBoxTestgroup = document.getElementById('testgroup_subgroups');
selectBoxTestgroup.options.length = 0;
for (var i=0; i<testgroup.subgroups.length; i++) {
var optionText = testgroup.subgroups[i].name + ' (' + testgroup.subgroups[i].subgroup_id + ')';
@ -183,42 +152,44 @@ function populateTestgroup(data) {
function blankTestgroupForm(formid) {
blankForm(formid);
document.getElementById('editform_testgroup_id_display').innerHTML = '';
var selectBoxAll = document.getElementById('editform_subgroups_for_product');
document.getElementById('testgroup_id_display').innerHTML = '';
var selectBoxAll = document.getElementById('subgroups_for_product');
selectBoxAll.options.length = 0;
selectBoxAll.options[selectBoxAll.length] = new Option("--No product selected--",
selectBoxAll.options[selectBoxAll.length] = new Option("-No product selected-",
"");
selectBoxAll.selectedIndex=-1;
var selectBoxTestgroup = document.getElementById('editform_testgroup_subgroups');
var selectBoxTestgroup = document.getElementById('testgroup_subgroups');
selectBoxTestgroup.options.length = 0;
selectBoxTestgroup.options[selectBoxTestgroup.length] = new Option("--No testgroup selected--","");
selectBoxTestgroup.options[selectBoxTestgroup.length] = new Option("-No testgroup selected-","");
selectBoxTestgroup.selectedIndex=-1;
document.getElementById('editform_testrunner_plan_id').innerHTML = '';
document.getElementById('testrunner_plan_id').innerHTML = '';
document.getElementById('product_text').innerHTML = '';
document.getElementById('branch_text').innerHTML = '';
testgroup = new Object();
changeProduct();
populateBranches(document.getElementById('editform_product'));
var productBox = document.getElementById('product');
var branchBox = document.getElementById('branch');
populateBranches(branchBox,productBox);
}
function switchToAdd() {
disableModeButtons();
blankTestgroupForm('edit_testgroup_form');
document.getElementById('editform_testgroup_id_display').innerHTML = '<em>Automatically generated for a new testgroup</em>';
document.getElementById('editform_testrunner_plan_id').innerHTML = '<em>Not Applicable</em>';
document.getElementById('editform_submit').value = 'Add Testgroup';
document.getElementById('editform_mode').value = 'add';
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('submit').value = 'Add Testgroup';
document.getElementById('mode').value = 'add';
enableForm('edit_testgroup_form');
document.getElementById('testgroup_display_div').style.display = 'none';
document.getElementById('editform_div').style.display = 'block';
}
function switchToEdit() {
document.getElementById('editform_submit').value = 'Submit Edits';
document.getElementById('editform_mode').value = 'edit';
document.getElementById('submit').value = 'Submit Edits';
document.getElementById('mode').value = 'edit';
enableForm('edit_testgroup_form');
document.getElementById('testgroup_display_div').style.display = 'none';
document.getElementById('editform_div').style.display = 'block';
@ -227,9 +198,9 @@ function switchToEdit() {
function populateAllSubgroups() {
toggleMessage('loading','Narrowing Subgroup List...');
try {
var productBox = document.getElementById('editform_product');
var branchBox = document.getElementById('editform_branch');
var selectBoxAll = document.getElementById('editform_subgroups_for_product');
var productBox = document.getElementById('product');
var branchBox = document.getElementById('branch');
var selectBoxAll = document.getElementById('subgroups_for_product');
selectBoxAll.options.length = 0;
for (var i in subgroups) {
if (subgroups[i].product_id != productBox.options[productBox.selectedIndex].value) {
@ -268,9 +239,9 @@ function resetTestgroup() {
function checkFormContents(f) {
return (
checkString(f.editform_name, 'Name') &&
verifySelected(f.editform_product, 'Product') &&
verifySelected(f.editform_branch, 'Branch')
checkString(f.name, 'Name') &&
verifySelected(f.product, 'Product') &&
verifySelected(f.branch, 'Branch')
);
}

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

@ -4,7 +4,7 @@ function tc_init() {
allStretch.hideAll();
testConfigHeight = new fx.Height('testconfig', {duration: 400});
testConfigHeight = new fx.Height('test_run_summary', {duration: 400});
testConfigHeight.toggle();
allStretch.fxa[0].toggle();
@ -14,3 +14,191 @@ function confirmPartialSubmission() {
msg = "Did you intend to only submit a single test result? (Hint: There is a 'Submit All Results' button at the bottom of the page.)";
return confirm(msg);
}
function confirmTestRunSelection(testRunUrl) {
if (confirm("Does your config match that listed in the details and criteria (if any)?")) {
document.location = testRunUrl;
}
}
function checkFormContents(f) {
var criteria = document.getElementsByName('criterion');
if (checkRadio(criteria,'required criteria')) {
if (criteria[0].value == 'new') {
return (
checkBuildId(document.getElementById('build_id_new'), false) &&
verifySelected(document.getElementById('platform_new'), 'platform') &&
verifySelected(document.getElementById('opsys_new'), 'operating system')
);
} else {
for (var i=0; i<criteria.length; i++) {
if (criteria[i].checked == true) {
var a = new Array;
a = criteria[i].value.split('|');
return (
verifySelected(document.getElementById('platform_'+a[0]), 'platform') &&
verifySelected(document.getElementById('opsys_'+a[0]), 'operating system')
);
}
}
}
}
return false;
}
function addRowToTable(tblName,position,buildID,platformID,opsysID) {
var tbl = document.getElementById(tblName);
var row = tbl.insertRow(position);
if (position % 2 == 0) {
row.setAttribute('class', 'even');
} else {
row.setAttribute('class', 'odd');
}
// Radio button cell
var cellRadioButton = row.insertCell(0);
cellRadioButton.setAttribute('align', 'center');
var el = document.createElement('input');
cellRadioButton.appendChild(el);
el.setAttribute('type', 'radio');
el.setAttribute('name', 'criterion');
el.setAttribute('id', 'criterion');
if (buildID) {
el.setAttribute('value', position+'|'+
buildID+'|'+
platformID+'|'+
opsysID
);
} else {
el.setAttribute('value', 'new');
el.setAttribute('checked',true)
}
// Build ID cell
var cellBuildID = row.insertCell(1);
cellBuildID.setAttribute('align', 'center');
if (buildID) {
cellBuildID.innerHTML = "<strong>" + buildID + "</strong>" +
"<input type='hidden' name='build_id_" + position +
"' id='build_id_" + position + "' value='" + buildID + "' />";
} else {
var el = document.createElement('input');
el.setAttribute('type', 'text');
el.setAttribute('name', 'build_id_new');
el.setAttribute('id', 'build_id_new');
el.setAttribute('size', '10');
if (appBuildID) {
el.setAttribute('value', appBuildID);
}
el.onchange = new Function("if (!checkBuildId(this,true)) { this.value = ''; this.focus(); }");
cellBuildID.appendChild(el);
}
// Platform cell
var cellPlatform = row.insertCell(2);
cellPlatform.setAttribute('align', 'center');
var el = document.createElement('select');
if (buildID) {
el.setAttribute('name', 'platform_' + position);
el.setAttribute('id', 'platform_' + position);
el.setAttribute('onChange', "changePlatform('_"+position+"')");
} else {
el.setAttribute('name', 'platform_new');
el.setAttribute('id', 'platform_new');
el.setAttribute('onChange', "changePlatform('_new')");
}
el.setAttribute('size', '1');
el.setAttribute('class', 'select_platform');
el.options[0] = new Option('-Platform (ID#)-','');
for(var i=0;i<platforms.length;i+=1) {
el.options[i+1] = new Option(platforms[i].name+' ('+platforms[i].platform_id+')',platforms[i].platform_id);
}
cellPlatform.appendChild(el);
// Opsys cell
var cellOpsys = row.insertCell(3);
cellOpsys.setAttribute('align', 'center');
var el = document.createElement('select');
if (buildID) {
el.setAttribute('name', 'opsys_' + position);
el.setAttribute('id', 'opsys_' + position);
} else {
el.setAttribute('name', 'opsys_new');
el.setAttribute('id', 'opsys_new');
}
el.setAttribute('size', '1');
el.setAttribute('class', 'select_opsys');
el.options[0] = new Option('-Operating System (ID#)-','');
cellOpsys.appendChild(el);
if (platformID) {
var platformBox = document.getElementById('platform_' + position);
platformBox.setAttribute('disabled','true');
setSelected(platformBox,platformID);
changePlatform('_'+position);
}
if (opsysID) {
var opsysBox = document.getElementById('opsys_' + position);
opsysBox.setAttribute('disabled','true');
setSelected(opsysBox,opsysID);
}
}
function getBuildId() {
if (navigator.buildID && appBuildID == "0000000000") {
appBuildID=navigator.buildID;
} else if (appBuildID == "0000000000") {
try {
netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
var appInfo = Components.classes["@mozilla.org/xre/app-info;1"].getService(Components.interfaces.nsIXULAppInfo);
if(appInfo.appBuildID) {
appBuildID = appInfo.appBuildID;
}
} catch (e) {
// Cascade to the next lookup method.
}
}
}
function resetCriteria() {
var criteria = document.getElementsByName('criterion');
var suffix = '';
if (criteria[0].value == 'new') {
suffix='_new';
if (appBuildID && appBuildID != "0000000000") {
document.getElementById('build_id_new').value = appBuildID ;
} else {
document.getElementById('build_id_new').value = "" ;
}
}
for (var i=0; i<criteria.length; i++) {
if (suffix != '_new') {
var a = new Array;
a = criteria[i].value.split('|');
suffix='_'+a[0];
}
// If the opsys is disabled, we don't have to reset this row because the
// will not have changed anything.
var platformBox = document.getElementById('platform'+suffix);
var opsysBox = document.getElementById('opsys'+suffix);
if (opsysBox.disabled == true) {
continue;
}
if (platformBox.disabled == false) {
setSelected(platformBox,'');
}
changePlatform(suffix);
setSelected(opsysBox,'');
}
}
var buildIDHelpTitle = 'How do I determine the build ID?';
var buildIDHelpText = '<p>The build ID is a 10-digit number that identifies a Mozilla product build down to the date and hour of the build. By supplying the full, correct build ID, you will be making the job of the Mozilla QA team <em>much</em> easier. There are several different ways to determine the build ID of the build you are testing.</p><ol><li><b>Manually</b>: Provided you have installed Talkback, this is the fail-safe method, and allows you to submit the build ID for products other than the one currently being used to submit the results. The Mozilla Quality Assurance wiki has instructions on <a target="external_link_from_litmus" href="http://wiki.mozilla.org/MozillaQualityAssurance:Build_Ids">how to manually verify the build ID</a>.</li><li><b>Nightly Tester Tools</b>: Available for both Firefox and Thunderbird, the Nightly Tester Tools extension adds a number of useful features for testing Mozilla products. This includes a handy display of the build ID of the running build in the title bar. You can download this extension from <a target="external_link_from_litmus" href="https://addons.mozilla.org/search.php?q=Nightly+Tester+Tools">addons.mozilla.org</a>.</li><li><b>Automatic detection</b>: Litmus has JavaScript code built-in to automatically detect the build ID of the current build, but it relies on <a target="external_link_from_litmus" href="http://www.mozilla.org/projects/security/components/signed-scripts.html#codebase">JavaScript codebase principals</a> to do so. To enable codebase principals, testers must add this line to the prefs.js file in their Mozilla user profile dir, or simply edit the pref directly in <a target="external_link_from_litmus" href="http://kb.mozillazine.org/About:config">about:config</a>:<br/><br/><b><code>user_pref("signed.applets.codebase_principal_support", true);</code></b><br/><br/><b>NOTE</b>: this will only be useful if you are submitting results for the currently running version of Firefox. If you are concerned about the security issues of enabling codebase support, you can <a target="external_link_from_litmus" href="http://www.mozilla.org/projects/security/components/signed-scripts.html#codebase">read more about codebase principals here</a>.</li></ol>';
var appBuildID = "0000000000";

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

@ -7,7 +7,7 @@ function MM_findObj(n, d) { //v4.01
}
function showsubgroup() {
var groupselect = MM_findObj("group");
var groupselect = MM_findObj("testgroup");
if (!groupselect) {
return;
@ -68,6 +68,6 @@ function showsubgroup() {
}
function group_init() {
testConfigHeight = new fx.Height('testconfig', {duration: 400});
testConfigHeight.hide();
testConfigHeight = new fx.Height('test_run_summary', {duration: 400});
testConfigHeight.toggle();
}

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

@ -0,0 +1,30 @@
var coverageCells;
function beginCoverageLookup() {
coverageCells = document.getElementsByClassName('coverage');
getCoverage();
}
function getCoverage() {
var coverageCell = coverageCells.shift();
if (coverageCell) {
var test_run_id = coverageCell.id.match(/\d+/);
var url = 'json.cgi?coverage=1&test_run_id=' + test_run_id;
fetchJSON(url,updateCoverage,1);
}
}
function updateCoverage(data) {
test_run=data;
var coverageCell = document.getElementById('coverage_'+test_run.test_run_id);
if (coverageCell) {
if (test_run.coverage == 100) {
coverageCell.setAttribute('class','coverage-complete');
}
coverageCell.innerHTML = '<a href="test_run_report.cgi?test_run_id=' +
test_run.test_run_id + '">' +
test_run.coverage + '%</a>';
}
getCoverage();
}

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

@ -1,57 +1,3 @@
function changeProduct(productSelectBox) {
if (productSelectBox.selectedIndex &&
productSelectBox.options[productSelectBox.selectedIndex].value != '') {
var testgroupSelectBox = document.getElementById('testgroup_id');
if (testgroupSelectBox) {
testgroupSelectBox.options.length = 0;
testgroupSelectBox.options[0] = new Option('-Testgroup-','');
var i = 1;
for (var j=0; j<testgroups.length; j++) {
if (testgroups[j].product_id == productSelectBox.options[productSelectBox.selectedIndex].value) {
testgroupSelectBox.options[i] = new Option(testgroups[j].name,testgroups[j].testgroup_id);
i++;
}
}
}
var subgroupSelectBox = document.getElementById('subgroup_id');
if (subgroupSelectBox) {
subgroupSelectBox.options.length = 0;
subgroupSelectBox.options[0] = new Option('-Subgroup-','');
var i = 1;
for (var j=0; j<subgroups.length; j++) {
if (subgroups[j].product_id == productSelectBox.options[productSelectBox.selectedIndex].value) {
subgroupSelectBox.options[i] = new Option(subgroups[j].name,subgroups[j].subgroup_id);
i++;
}
}
}
}
}
function changeTestgroup(testgroupSelectBox) {
if (testgroupSelectBox.selectedIndex &&
testgroupSelectBox.options[testgroupSelectBox.selectedIndex].value != '') {
var subgroupSelectBox = document.getElementById('subgroup_id');
if (subgroupSelectBox) {
subgroupSelectBox.options.length = 0;
subgroupSelectBox.options[0] = new Option('-Subgroup-','');
var i = 1;
for (var j=0; j<subgroups.length; j++) {
if (subgroups[j].testgroup_id == testgroupSelectBox.options[testgroupSelectBox.selectedIndex].value) {
subgroupSelectBox.options[i] = new Option(subgroups[j].name,subgroups[j].subgroup_id);
i++;
}
}
}
}
}
function checkCategoryForm(f) {
return verifySelected(f.product, 'Product');
}

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

@ -308,100 +308,6 @@ if ($c->param) {
}
}
# Process testday changes.
if ($c->param("delete_testday_button") and
$c->param("testday_id")) {
my $testday_id = $c->param("testday_id");
my $testday = Litmus::DB::TestDay->retrieve($testday_id);
if ($testday) {
$rv = $testday->delete;
if ($rv) {
$status = "success";
$message = "Testday ID# $testday_id deleted successfully.";
$rebuild_cache=1;
} else {
$status = "failure";
$message = "Failed to delete testday ID# $testday_id.";
}
} else {
$status = "failure";
$message = "Testday ID# $testday_id does not exist. (Already deleted?)";
}
} elsif ($c->param("edit_testday_form_mode")) {
if ($c->param("edit_testday_form_mode") eq "add") {
my %hash = (
description => $c->param('edit_testday_form_desc'),
start_timestamp => $c->param('edit_testday_form_start_timestamp'),
finish_timestamp => $c->param('edit_testday_form_finish_timestamp'),
);
if ($c->param('testday_product_id')) {
$hash{product_id} = $c->param('testday_product_id');
}
if ($c->param('testday_branch_id')) {
$hash{branch_id} = $c->param('testday_branch_id');
}
if ($c->param('testday_testgroup_id')) {
$hash{testgroup_id} = $c->param('testday_testgroup_id');
}
if ($c->param('testday_build_id')) {
$hash{build_id} = $c->param('testday_build_id');
}
if ($c->param('testday_locale') and
$c->param('testday_locale') ne "") {
$hash{locale_abbrev} = $c->param('testday_locale');
}
my $new_testday =
Litmus::DB::TestDay->create(\%hash);
if ($new_testday) {
$status = "success";
$message = "Testday added successfully. New testday ID# is " . $new_testday->testday_id;
$defaults->{'testday_id'} = $new_testday->testday_id;
$rebuild_cache=1;
} else {
$status = "failure";
$message = "Failed to add testday.";
}
} elsif ($c->param("edit_testday_form_mode") eq "edit") {
my $testday_id = $c->param("edit_testday_form_testday_id");
my $testday = Litmus::DB::TestDay->retrieve($testday_id);
if ($testday) {
$testday->description($c->param('edit_testday_form_desc'));
$testday->start_timestamp($c->param('edit_testday_form_start_timestamp'));
$testday->finish_timestamp($c->param('edit_testday_form_finish_timestamp'));
if ($c->param('testday_product_id')) {
$testday->product_id($c->param('testday_product_id'));
}
if ($c->param('testday_branch_id')) {
$testday->branch_id($c->param('testday_branch_id'));
}
if ($c->param('testday_testgroup_id')) {
$testday->testgroup_id($c->param('testday_testgroup_id'));
}
if ($c->param('testday_build_id')) {
$testday->build_id($c->param('testday_build_id'));
}
if ($c->param('testday_locale') and
$c->param('testday_locale') ne "") {
$testday->locale_abbrev($c->param('testday_locale'));
}
$rv = $testday->update();
if ($rv) {
$status = "success";
$message = "Testday ID# $testday_id updated successfully.";
$defaults->{'testday_id'} = $testday_id;
$rebuild_cache=1;
} else {
$status = "failure";
$message = "Failed to update testday ID# $testday_id.";
}
} else {
$status = "failure";
$message = "Testday ID# $testday_id not found.";
}
}
}
}
if ($rebuild_cache) {
@ -413,7 +319,6 @@ my $platforms = Litmus::FormWidget->getPlatforms();
my $branches = Litmus::FormWidget->getBranches();
my $testgroups = Litmus::FormWidget->getTestgroups();
my $opsyses = Litmus::FormWidget->getOpsyses();
my $testdays = Litmus::FormWidget->getTestdays();
my $locales = Litmus::FormWidget->getLocales;
my $json = JSON->new(skipinvalid => 1, convblessed => 1);
@ -427,7 +332,6 @@ my $vars = {
platforms => $platforms,
branches => $branches,
opsyses => $opsyses,
testdays => $testdays,
locales => $locales,
};
@ -439,7 +343,6 @@ if ($status and $message) {
$vars->{'onload'} = "toggleMessage('$status','$message');";
}
my $cookie = Litmus::Auth::getCookie();
$vars->{"defaultemail"} = $cookie;
$vars->{"show_admin"} = Litmus::Auth::istrusted($cookie);

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

@ -31,7 +31,6 @@ use strict;
use Litmus;
use Litmus::Auth;
use Litmus::Cache;
use Litmus::Error;
use Litmus::FormWidget;
use Litmus::Utils;
@ -54,15 +53,21 @@ my $rv;
if ($c->param("searchSubgroupList")) {
print $c->header('text/plain');
my $product_id = $c->param("product");
my $branch_id = $c->param("branch");
my $testgroup_id = $c->param("testgroup");
my $subgroups;
if ($testgroup_id) {
$subgroups = Litmus::DB::Subgroup->search_ByTestgroup($testgroup_id);
} elsif ($branch_id) {
$subgroups = Litmus::DB::Subgroup->search(branch => $branch_id);
} elsif ($product_id) {
$subgroups = Litmus::DB::Subgroup->search(product => $product_id);
} else {
$subgroups = Litmus::DB::Subgroup->retrieve_all;
}
while (my $sg = $subgroups->next) {
print $sg->subgroup_id()."\n";
}
@ -76,7 +81,7 @@ Litmus::Auth::requireAdmin('manage_subgroups.cgi');
if ($c->param("subgroup_id")) {
$subgroup_id = $c->param("subgroup_id");
}
my $rebuild_cache = 0;
my $defaults;
if ($c->param("delete_subgroup_button")) {
my $subgroup = Litmus::DB::Subgroup->retrieve($subgroup_id);
@ -85,7 +90,6 @@ if ($c->param("delete_subgroup_button")) {
if ($rv) {
$status = "success";
$message = "Subgroup ID# $subgroup_id deleted successfully.";
$rebuild_cache = 1;
} else {
$status = "failure";
$message = "Failed to delete Subgroup ID# $subgroup_id.";
@ -101,54 +105,51 @@ if ($c->param("delete_subgroup_button")) {
$status = "success";
$message = "Subgroup cloned successfully. New subgroup ID# is " . $new_subgroup->subgroup_id;
$defaults->{'subgroup_id'} = $new_subgroup->subgroup_id;
$rebuild_cache = 1;
} else {
$status = "failure";
$message = "Failed to clone Subgroup ID# $subgroup_id.";
}
} elsif ($c->param("editform_mode")) {
requireField('product', $c->param('editform_product'));
requireField('branch', $c->param('editform_branch'));
my $enabled = $c->param('editform_enabled') ? 1 : 0;
if ($c->param("editform_mode") eq "add") {
} elsif ($c->param("mode")) {
requireField('product', $c->param('product'));
requireField('branch', $c->param('branch'));
my $enabled = $c->param('enabled') ? 1 : 0;
if ($c->param("mode") eq "add") {
my %hash = (
name => $c->param('editform_name'),
product_id => $c->param('editform_product'),
branch_id => $c->param('editform_branch'),
name => $c->param('name'),
product_id => $c->param('product'),
branch_id => $c->param('branch'),
enabled => $enabled,
);
my $new_subgroup =
Litmus::DB::Subgroup->create(\%hash);
if ($new_subgroup) {
my @selected_testcases = $c->param("editform_subgroup_testcases");
my @selected_testcases = $c->param("subgroup_testcases");
$new_subgroup->update_testcases(\@selected_testcases);
$status = "success";
$message = "Subgroup added successfully. New subgroup ID# is " . $new_subgroup->subgroup_id;
$defaults->{'subgroup_id'} = $new_subgroup->subgroup_id;
$rebuild_cache = 1;
} else {
$status = "failure";
$message = "Failed to add subgroup.";
}
} elsif ($c->param("editform_mode") eq "edit") {
} elsif ($c->param("mode") eq "edit") {
requireField('subgroup_id', $c->param("editform_subgroup_id"));
$subgroup_id = $c->param("editform_subgroup_id");
my $subgroup = Litmus::DB::Subgroup->retrieve($subgroup_id);
if ($subgroup) {
$subgroup->product_id($c->param('editform_product'));
$subgroup->branch_id($c->param('editform_branch'));
$subgroup->product_id($c->param('product'));
$subgroup->branch_id($c->param('branch'));
$subgroup->enabled($enabled);
$subgroup->name($c->param('editform_name'));
$subgroup->name($c->param('name'));
$rv = $subgroup->update();
if ($rv) {
my @selected_testcases = $c->param("editform_subgroup_testcases");
my @selected_testcases = $c->param("subgroup_testcases");
$subgroup->update_testcases(\@selected_testcases);
$status = "success";
$message = "Subgroup ID# $subgroup_id updated successfully.";
$defaults->{'subgroup_id'} = $subgroup_id;
$rebuild_cache = 1;
} else {
$status = "failure";
$message = "Failed to update subgroup ID# $subgroup_id.";
@ -170,21 +171,28 @@ if ($status and $message) {
$vars->{'onload'} = "toggleMessage('$status','$message');";
}
if ($rebuild_cache) {
Litmus::Cache::rebuildCache();
}
my $subgroups = Litmus::FormWidget->getSubgroups(0,'name');
my $products = Litmus::FormWidget->getProducts();
my $branches = Litmus::FormWidget->getBranches();
my $testgroups = Litmus::FormWidget->getTestgroups(0);
my $subgroups = Litmus::FormWidget->getSubgroups(0,'name');
my $testcases = Litmus::FormWidget->getTestcases(0,'name');
my $json = JSON->new(skipinvalid => 1, convblessed => 1);
my $products_js = $json->objToJson($products);
my $branches_js = $json->objToJson($branches);
my $testgroups_js = $json->objToJson($testgroups);
my $subgroups_js = $json->objToJson($subgroups);
my $testcases_js = $json->objToJson($testcases);
$vars->{'title'} = "Manage Subgroups";
$vars->{'subgroups'} = $subgroups;
$vars->{'products'} = $products;
$vars->{'all_testcases'} = $testcases_js;
$vars->{'subgroups'} = $subgroups;
$vars->{'products_js'} = $products_js;
$vars->{'branches_js'} = $branches_js;
$vars->{'testgroups_js'} = $testgroups_js;
$vars->{'subgroups_js'} = $subgroups_js;
$vars->{'testcases_js'} = $testcases_js;
$vars->{'user'} = Litmus::Auth::getCurrentUser();
my $cookie = Litmus::Auth::getCookie();
@ -195,4 +203,3 @@ print $c->header();
Litmus->template()->process("admin/manage_subgroups.tmpl", $vars) ||
internalError("Error loading template.");

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

@ -0,0 +1,260 @@
#!/usr/bin/perl -w
# -*- mode: cperl; c-basic-offset: 8; indent-tabs-mode: nil; -*-
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1
#
# 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 Litmus.
#
# The Initial Developer of the Original Code is
# the Mozilla Corporation.
# Portions created by the Initial Developer are Copyright (C) 2006
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
# Chris Cooper <ccooper@deadsquid.com>
# Zach Lipton <zach@zachlipton.com>
#
# ***** END LICENSE BLOCK *****
use strict;
use Litmus;
use Litmus::Auth;
use Litmus::Error;
use Litmus::FormWidget;
use Litmus::Utils;
use Litmus::DB::TestRun;
use CGI;
use Date::Manip;
use JSON;
my $c = Litmus->cgi();
my $vars;
my $test_run_id;
my $message;
my $status;
my $rv;
if ($c->param("searchTestRunList")) {
print $c->header('text/plain');
my $product_id = $c->param("product");
my $branch_id = $c->param("branch");
my $test_runs;
if ($branch_id) {
$test_runs = Litmus::DB::TestRun->search(branch => $branch_id);
} elsif ($product_id) {
$test_runs = Litmus::DB::TestRun->search(product => $product_id);
} else {
$test_runs = Litmus::DB::TestRun->retrieve_all;
}
while (my $tg = $test_runs->next) {
print $tg->test_run_id()."\n";
}
exit;
}
Litmus::Auth::requireAdmin('manage_test_runs.cgi');
if ($c->param("test_run_id")) {
$test_run_id = $c->param("test_run_id");
}
my $defaults;
if ($c->param("delete_test_run_button")) {
my $test_run = Litmus::DB::TestRun->retrieve($test_run_id);
if ($test_run) {
$rv = $test_run->delete_with_refs();
if ($rv) {
$status = "success";
$message = "Test run ID# $test_run_id deleted successfully.";
} else {
$status = "failure";
$message = "Failed to delete Test run ID# $test_run_id.";
}
} else {
$status = "failure";
$message = "Test run ID# $test_run_id does not exist. (Already deleted?)";
}
} elsif ($c->param("clone_test_run_button")) {
my $test_run = Litmus::DB::TestRun->retrieve($test_run_id);
my $new_test_run = $test_run->clone;
if ($new_test_run) {
$status = "success";
$message = "Test run cloned successfully. New test_run ID# is " . $new_test_run->test_run_id;
$defaults->{'test_run_id'} = $new_test_run->test_run_id;
} else {
$status = "failure";
$message = "Failed to clone Test run ID# $test_run_id.";
}
} elsif ($c->param("mode")) {
requireField('name', $c->param('name'));
requireField('product', $c->param('product'));
requireField('branch', $c->param('branch'));
requireField('start_timestamp', $c->param('start_timestamp'));
requireField('finish_timestamp', $c->param('finish_timestamp'));
my $enabled = $c->param('enabled') ? 1 : 0;
my $recommended = $c->param('recommended') ? 1 : 0;
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'),
description => $c->param('description'),
product_id => $c->param('product'),
branch_id => $c->param('branch'),
start_timestamp => $c->param('start_timestamp'),
finish_timestamp => $c->param('finish_timestamp'),
enabled => $enabled,
recommended => $recommended,
author_id => $c->param('author_id'),
creation_date => $now,
last_updated => $now,
);
my $test_run =
Litmus::DB::TestRun->create(\%hash);
if ($test_run) {
$test_run->update_testgroups(\@selected_testgroups);
if ($criteria and
$#$criteria >= 0) {
$test_run->update_criteria($criteria);
}
$status = "success";
$message = "Test run added successfully. New test run ID# is " . $test_run->test_run_id;
$defaults->{'test_run_id'} = $test_run->test_run_id;
} else {
$status = "failure";
$message = "Failed to add test run.";
}
} elsif ($c->param("mode") eq "edit") {
requireField('test_run_id', $c->param("editform_test_run_id"));
$test_run_id = $c->param("editform_test_run_id");
my $test_run = Litmus::DB::TestRun->retrieve($test_run_id);
if ($test_run) {
$test_run->name($c->param('name'));
$test_run->description($c->param('description'));
$test_run->product_id($c->param('product'));
$test_run->branch_id($c->param('branch'));
$test_run->start_timestamp($c->param('start_timestamp'));
$test_run->finish_timestamp($c->param('finish_timestamp'));
$test_run->enabled($enabled);
$test_run->recommended($recommended);
$test_run->author_id($c->param('author_id'));
my $version = $test_run->version;
$version++;
$test_run->version($version);
$test_run->last_updated($now);
$rv = $test_run->update();
if ($rv) {
$test_run->update_testgroups(\@selected_testgroups);
if ($criteria and
$#$criteria >= 0) {
$test_run->update_criteria($criteria);
}
$status = "success";
$message = "Test run ID# $test_run_id updated successfully.";
$defaults->{'test_run_id'} = $test_run->test_run_id;
} else {
$status = "failure";
$message = "Failed to update test run.";
}
} else {
$status = "failure";
$message = "Test run ID# $test_run_id not found.";
}
}
} else {
$defaults->{'test_run_id'} = $c->param("test_run_id");
}
if ($defaults) {
$vars->{'defaults'} = $defaults;
}
if ($status and $message) {
$vars->{'onload'} = "toggleMessage('$status','$message');";
}
my $test_runs = Litmus::FormWidget->getTestRuns;
my $products = Litmus::FormWidget->getProducts;
my $branches = Litmus::FormWidget->getBranches;
my $testgroups = Litmus::FormWidget->getTestgroups;
my $platforms = Litmus::FormWidget->getPlatforms();
my $opsyses = Litmus::FormWidget->getOpsyses();
my $authors = Litmus::FormWidget->getAuthors();
my $json = JSON->new(skipinvalid => 1, convblessed => 1);
my $products_js = $json->objToJson($products);
my $branches_js = $json->objToJson($branches);
my $testgroups_js = $json->objToJson($testgroups);
my $platforms_js = $json->objToJson($platforms);
my $opsyses_js = $json->objToJson($opsyses);
$vars->{'title'} = "Manage Test Runs";
$vars->{'test_runs'} = $test_runs;
$vars->{'products'} = $products;
$vars->{'platforms'} = $platforms;
$vars->{'opsyses'} = $opsyses;
$vars->{'authors'} = $authors;
$vars->{'user'} = Litmus::Auth::getCurrentUser();
$vars->{'products_js'} = $products_js;
$vars->{'branches_js'} = $branches_js;
$vars->{'testgroups_js'} = $testgroups_js;
$vars->{'platforms_js'} = $platforms_js;
$vars->{'opsyses_js'} = $opsyses_js;
my $cookie = Litmus::Auth::getCookie();
$vars->{"defaultemail"} = $cookie;
$vars->{"show_admin"} = Litmus::Auth::istrusted($cookie);
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;
}

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

@ -31,13 +31,13 @@ use strict;
use Litmus;
use Litmus::Auth;
use Litmus::Cache;
use Litmus::Error;
use Litmus::FormWidget;
use Litmus::Utils;
use CGI;
use Date::Manip;
use JSON;
Litmus->init();
my $c = Litmus->cgi();
@ -53,6 +53,7 @@ my $rv;
if ($c->param("searchTestcaseList")) {
print $c->header('text/plain');
my $product_id = $c->param("product");
my $branch_id = $c->param("branch");
my $testgroup_id = $c->param("testgroup");
my $subgroup_id = $c->param("subgroup");
@ -62,8 +63,12 @@ if ($c->param("searchTestcaseList")) {
$tests = Litmus::DB::Testcase->search_BySubgroup($subgroup_id);
} elsif ($testgroup_id) {
$tests = Litmus::DB::Testcase->search_ByTestgroup($testgroup_id);
} elsif ($branch_id) {
$tests = Litmus::DB::Testcase->search(branch => $branch_id);
} elsif ($product_id) {
$tests = Litmus::DB::Testcase->search(product => $product_id);
} else {
$tests = Litmus::DB::Testcase->retrieve_all;
}
while (my $t = $tests->next) {
print $t->testcase_id()."\n";
@ -82,7 +87,6 @@ if ($c->param("testcase_id")) {
}
}
my $rebuild_cache = 0;
my $defaults;
if ($c->param("delete_testcase_button")) {
my $testcase = Litmus::DB::Testcase->retrieve($testcase_id);
@ -91,7 +95,6 @@ if ($c->param("delete_testcase_button")) {
if ($rv) {
$status = "success";
$message = "Testcase ID# $testcase_id deleted successfully.";
$rebuild_cache=1;
} else {
$status = "failure";
$message = "Failed to delete Testcase ID# $testcase_id.";
@ -107,30 +110,29 @@ if ($c->param("delete_testcase_button")) {
$status = "success";
$message = "Testcase cloned successfully. New testcase ID# is " . $new_testcase->testcase_id;
$defaults->{'testcase_id'} = $new_testcase->testcase_id;
$rebuild_cache=1;
} else {
$status = "failure";
$message = "Failed to clone Testcase ID# $testcase_id.";
}
} elsif ($c->param("editform_mode")) {
requireField('summary', $c->param('editform_summary'));
requireField('product', $c->param('editform_product'));
requireField('branch', $c->param('editform_branch'));
requireField('author', $c->param('editform_author_id'));
my $enabled = $c->param('editform_enabled') ? 1 : 0;
my $community_enabled = $c->param('editform_communityenabled') ? 1 : 0;
} elsif ($c->param("mode")) {
requireField('summary', $c->param('summary'));
requireField('product', $c->param('product'));
requireField('branch', $c->param('branch'));
requireField('author', $c->param('author_id'));
my $enabled = $c->param('enabled') ? 1 : 0;
my $community_enabled = $c->param('communityenabled') ? 1 : 0;
my $now = &UnixDate("today","%q");
if ($c->param("editform_mode") eq "add") {
if ($c->param("mode") eq "add") {
my %hash = (
summary => $c->param('editform_summary'),
steps => $c->param('editform_steps') ? $c->param('editform_steps') : '',
expected_results => $c->param('editform_results') ? $c->param('editform_results') : '',
product_id => $c->param('editform_product'),
branch_id => $c->param('editform_branch'),
summary => $c->param('summary'),
steps => $c->param('steps') ? $c->param('steps') : '',
expected_results => $c->param('results') ? $c->param('results') : '',
product_id => $c->param('product'),
branch_id => $c->param('branch'),
enabled => $enabled,
community_enabled => $community_enabled,
regression_bug_id => $c->param('editform_regression_bug_id') ? $c->param('editform_regression_bug_id') : '',
author_id => $c->param('editform_author_id'),
regression_bug_id => $c->param('regression_bug_id') ? $c->param('regression_bug_id') : '',
author_id => $c->param('author_id'),
creation_date => $now,
last_updated => $now,
);
@ -141,26 +143,25 @@ if ($c->param("delete_testcase_button")) {
$status = "success";
$message = "Testcase added successfully. New testcase ID# is " . $new_testcase->testcase_id;
$defaults->{'testcase_id'} = $new_testcase->testcase_id;
$rebuild_cache=1;
} else {
$status = "failure";
$message = "Failed to add testcase.";
}
} elsif ($c->param("editform_mode") eq "edit") {
} elsif ($c->param("mode") eq "edit") {
requireField('testcase_id', $c->param("editform_testcase_id"));
$testcase_id = $c->param("editform_testcase_id");
my $testcase = Litmus::DB::Testcase->retrieve($testcase_id);
if ($testcase) {
$testcase->summary($c->param('editform_summary'));
$testcase->steps($c->param('editform_steps') ? $c->param('editform_steps') : '');
$testcase->expected_results($c->param('editform_results') ? $c->param('editform_results') : '');
$testcase->product_id($c->param('editform_product'));
$testcase->branch_id($c->param('editform_branch'));
$testcase->summary($c->param('summary'));
$testcase->steps($c->param('steps') ? $c->param('steps') : '');
$testcase->expected_results($c->param('results') ? $c->param('results') : '');
$testcase->product_id($c->param('product'));
$testcase->branch_id($c->param('branch'));
$testcase->enabled($enabled);
$testcase->community_enabled($community_enabled);
$testcase->regression_bug_id($c->param('editform_regression_bug_id') ? $c->param('editform_regression_bug_id') : '');
$testcase->author_id($c->param('editform_author_id'));
$testcase->regression_bug_id($c->param('regression_bug_id') ? $c->param('regression_bug_id') : '');
$testcase->author_id($c->param('author_id'));
$testcase->last_updated($now);
$testcase->version($testcase->version + 1);
$rv = $testcase->update();
@ -168,7 +169,6 @@ if ($c->param("delete_testcase_button")) {
$status = "success";
$message = "Testcase ID# $testcase_id updated successfully.";
$defaults->{'testcase_id'} = $testcase_id;
$rebuild_cache=1;
} else {
$status = "failure";
$message = "Failed to update testcase ID# $testcase_id.";
@ -190,17 +190,26 @@ if ($status and $message) {
$vars->{'onload'} = "toggleMessage('$status','$message');";
}
if ($rebuild_cache) {
Litmus::Cache::rebuildCache();
}
my $testcases = Litmus::FormWidget->getTestcases(0,'name');
my $products = Litmus::FormWidget->getProducts();
my $branches = Litmus::FormWidget->getBranches();
my $testgroups = Litmus::FormWidget->getTestgroups(0);
my $subgroups = Litmus::FormWidget->getSubgroups(0,'name');
my $testcases = Litmus::FormWidget->getTestcases(0,'name');
my $authors = Litmus::FormWidget->getAuthors();
my $json = JSON->new(skipinvalid => 1, convblessed => 1);
my $products_js = $json->objToJson($products);
my $branches_js = $json->objToJson($branches);
my $testgroups_js = $json->objToJson($testgroups);
my $subgroups_js = $json->objToJson($subgroups);
$vars->{'title'} = "Manage Testcases";
$vars->{'testcases'} = $testcases;
$vars->{'products'} = $products;
$vars->{'products_js'} = $products_js;
$vars->{'branches_js'} = $branches_js;
$vars->{'testgroups_js'} = $testgroups_js;
$vars->{'subgroups_js'} = $subgroups_js;
$vars->{'authors'} = $authors;
$vars->{'user'} = Litmus::Auth::getCurrentUser();
$vars->{'edit'} = $edit;

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

@ -31,7 +31,6 @@ use strict;
use Litmus;
use Litmus::Auth;
use Litmus::Cache;
use Litmus::Error;
use Litmus::FormWidget;
use Litmus::Utils;
@ -53,8 +52,17 @@ my $rv;
if ($c->param("searchTestgroupList")) {
print $c->header('text/plain');
my $product_id = $c->param("product");
my $branch_id = $c->param("branch");
my $testgroups;
if ($branch_id) {
$testgroups = Litmus::DB::Testgroup->search(branch => $branch_id);
} elsif ($product_id) {
$testgroups = Litmus::DB::Testgroup->search(product => $product_id);
} else {
$testgroups = Litmus::DB::Testgroup->retrieve_all;
}
my $testgroups = Litmus::DB::Testgroup->search(product => $product_id);
while (my $tg = $testgroups->next) {
print $tg->testgroup_id()."\n";
}
@ -68,7 +76,7 @@ Litmus::Auth::requireAdmin('manage_testgroups.cgi');
if ($c->param("testgroup_id")) {
$testgroup_id = $c->param("testgroup_id");
}
my $rebuild_cache = 0;
my $defaults;
if ($c->param("delete_testgroup_button")) {
my $testgroup = Litmus::DB::Testgroup->retrieve($testgroup_id);
@ -77,7 +85,6 @@ if ($c->param("delete_testgroup_button")) {
if ($rv) {
$status = "success";
$message = "Testgroup ID# $testgroup_id deleted successfully.";
$rebuild_cache = 1;
} else {
$status = "failure";
$message = "Failed to delete Testgroup ID# $testgroup_id.";
@ -93,55 +100,50 @@ if ($c->param("delete_testgroup_button")) {
$status = "success";
$message = "Testgroup cloned successfully. New testgroup ID# is " . $new_testgroup->testgroup_id;
$defaults->{'testgroup_id'} = $new_testgroup->testgroup_id;
$rebuild_cache = 1;
} else {
$status = "failure";
$message = "Failed to clone Testgroup ID# $testgroup_id.";
}
} elsif ($c->param("editform_mode")) {
requireField('product', $c->param('editform_product'));
requireField('branch', $c->param('editform_branch'));
my $enabled = $c->param('editform_enabled') ? 1 : 0;
if ($c->param("editform_mode") eq "add") {
} elsif ($c->param("mode")) {
requireField('product', $c->param('product'));
requireField('branch', $c->param('branch'));
my $enabled = $c->param('enabled') ? 1 : 0;
if ($c->param("mode") eq "add") {
my %hash = (
name => $c->param('editform_name'),
product_id => $c->param('editform_product'),
name => $c->param('name'),
product_id => $c->param('product'),
enabled => $enabled,
branch_id => $c->param('editform_branch'),
branch_id => $c->param('branch'),
);
my $new_testgroup =
Litmus::DB::Testgroup->create(\%hash);
if ($new_testgroup) {
my @selected_subgroups = $c->param("editform_testgroup_subgroups");
my @selected_subgroups = $c->param("testgroup_subgroups");
$new_testgroup->update_subgroups(\@selected_subgroups);
# XXX: Placeholder for updating test runs
$status = "success";
$message = "Testgroup added successfully. New testgroup ID# is " . $new_testgroup->testgroup_id;
$defaults->{'testgroup_id'} = $new_testgroup->testgroup_id;
$rebuild_cache = 1;
} else {
$status = "failure";
$message = "Failed to add testgroup.";
}
} elsif ($c->param("editform_mode") eq "edit") {
} elsif ($c->param("mode") eq "edit") {
requireField('testgroup_id', $c->param("editform_testgroup_id"));
$testgroup_id = $c->param("editform_testgroup_id");
my $testgroup = Litmus::DB::Testgroup->retrieve($testgroup_id);
if ($testgroup) {
$testgroup->product_id($c->param('editform_product'));
$testgroup->branch_id($c->param('editform_branch'));
$testgroup->product_id($c->param('product'));
$testgroup->branch_id($c->param('branch'));
$testgroup->enabled($enabled);
$testgroup->name($c->param('editform_name'));
$testgroup->name($c->param('name'));
$rv = $testgroup->update();
if ($rv) {
my @selected_subgroups = $c->param("editform_testgroup_subgroups");
my @selected_subgroups = $c->param("testgroup_subgroups");
$testgroup->update_subgroups(\@selected_subgroups);
# XXX: Placeholder for updating test runs
$status = "success";
$message = "Testgroup ID# $testgroup_id updated successfully.";
$defaults->{'testgroup_id'} = $testgroup_id;
$rebuild_cache = 1;
} else {
$status = "failure";
$message = "Failed to update testgroup ID# $testgroup_id.";
@ -163,21 +165,23 @@ if ($status and $message) {
$vars->{'onload'} = "toggleMessage('$status','$message');";
}
if ($rebuild_cache) {
Litmus::Cache::rebuildCache();
}
my $testgroups = Litmus::FormWidget->getTestgroups;
my $products = Litmus::FormWidget->getProducts();
my $branches = Litmus::FormWidget->getBranches();
my $testgroups = Litmus::FormWidget->getTestgroups;
my $subgroups = Litmus::FormWidget->getSubgroups(0,'name');
my $json = JSON->new(skipinvalid => 1, convblessed => 1);
my $products_js = $json->objToJson($products);
my $branches_js = $json->objToJson($branches);
my $subgroups_js = $json->objToJson($subgroups);
$vars->{'title'} = "Manage Testgroups";
$vars->{'testgroups'} = $testgroups;
$vars->{'products'} = $products;
$vars->{'all_subgroups'} = $subgroups_js;
$vars->{'products_js'} = $products_js;
$vars->{'branches'} = $branches;
$vars->{'branches_js'} = $branches_js;
$vars->{'testgroups'} = $testgroups;
$vars->{'subgroups_js'} = $subgroups_js;
$vars->{'user'} = Litmus::Auth::getCurrentUser();
my $cookie = Litmus::Auth::getCookie();

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

@ -29,6 +29,9 @@
use strict;
use Time::HiRes qw( gettimeofday tv_interval );
our $t0 = [gettimeofday];
use Litmus;
use Litmus::Error;
use Litmus::DB::Product;
@ -42,7 +45,6 @@ use Litmus::XML;
use CGI;
use Date::Manip;
Litmus->init();
my $c = Litmus->cgi();
@ -58,20 +60,30 @@ if ($c->param('data')) {
exit; # that's all folks!
}
my $user;
my $sysconfig;
if ($c->param("isSysConfig")) {
$user = $user || Litmus::Auth::getCurrentUser();
if (!$user) {
my $return = $c->param("return") || 'index.cgi';
Litmus::Auth::requireLogin($return);
}
$sysconfig = Litmus::SysConfig->processForm($c);
# get the user id and set a sysconfig cookie
$c->storeCookie($sysconfig->setCookie());
}
Litmus::Auth::requireLogin("process_test.cgi");
my $user || Litmus::Auth::getCurrentUser();
print $c->header();
my $test_run_id = $c->param("test_run_id");
if (!$test_run_id) {
invalidInputError("No Test Run selected!");
exit 1;
}
my $test_run = Litmus::DB::TestRun->getTestRunWithRefs($test_run_id);
my $sysconfig = Litmus::SysConfig->getCookieByTestRunId($test_run_id);
if (!$sysconfig) {
invalidInputError("No system configuration information found!");
exit 1;
};
$c->storeCookie($sysconfig->setCookie());
$test_run->flagCriteriaInUse($sysconfig);
my @names = $c->param();
# find all the test numbers contained in this result submission
@ -82,11 +94,8 @@ foreach my $curname (@names) {
}
}
# don't get to use the simple test interface if you really
# have more than one test (i.e. you cheated and changed the
# hidden input)
if (scalar @tests > 1 && $c->param("isSimpleTest")) {
invalidInputError("Cannot use simpletest interface with more than one test");
if (scalar @tests <= 1) {
invalidInputError("No test results found!");
}
my $testcount;
@ -102,42 +111,13 @@ foreach my $curtestid (@tests) {
my $curtest = Litmus::DB::Testcase->retrieve($curtestid);
unless ($curtest) {
# oddly enough, the test doesn't exist
print STDERR "No testcase found for ID: $curtestid";
next;
}
$testcount++;
$product = $curtest->product();
my $ua = Litmus::UserAgentDetect->new();
# for simpletest, build a temporary sysconfig based on the
# UA string and product of this test:
if ($c->param("isSimpleTest")) {
$sysconfig = Litmus::SysConfig->new(
$curtest->product(),
$ua->platform($curtest->product()),
"NULL", # no way to autodetect the opsys
$ua->branch($curtest->product()),
$ua->build_id(),
);
}
# get system configuration. If there is no configuration and we're
# not doing the simpletest interface, then we make you enter it
# Get system configuration. If there is no configuration,
# then we make the user enter it.
if (!$sysconfig) {
$sysconfig = Litmus::SysConfig->getCookie($product);
}
# Users who still don't have a sysconfig for this product
# should go configure themselves first.
if (!$sysconfig) {
Litmus::SysConfig->displayForm($product,
"process_test.cgi",
$c);
exit;
}
my $result_status = Litmus::DB::ResultStatus->retrieve($c->param("testresult_".$curtestid));
$resultcounts{$result_status->name()}++;
@ -146,27 +126,19 @@ foreach my $curtestid (@tests) {
my $bugs = $c->param("bugs_".$curtestid);
my $time = &Date::Manip::UnixDate("now","%q");
# normally, the user comes with a cookie, but for simpletest
# users, we just use the web-user@mozilla.org user:
if ($c->param("isSimpleTest")) {
$user = $user || Litmus::DB::User->search(email => 'web-tester@mozilla.org')->next();
} else {
$user = $user || Litmus::Auth::getCookie()->user_id();
}
$user = $user || Litmus::Auth::getCookie()->user_id();
print STDERR "user: $user\n";
my $tr = Litmus::DB::Testresult->create({
user => $user,
testcase => $curtest,
timestamp => $time,
last_updated => $time,
useragent => $ua,
user_id => $user,
testcase => $curtest,
timestamp => $time,
last_updated => $time,
useragent => $ua,
result_status => $result_status,
opsys => $sysconfig->opsys(),
branch => $sysconfig->branch(),
build_id => $sysconfig->build_id(),
locale_abbrev => $sysconfig->locale(),
opsys_id => $sysconfig->{'opsys_id'},
branch_id => $test_run->branch_id,
build_id => $sysconfig->{'build_id'},
locale_abbrev => $sysconfig->{'locale'},
});
# if there's a note, create an entry in the comments table for it
@ -203,14 +175,9 @@ if (! $testcount) {
invalidInputError("No results submitted.");
}
my $testgroup;
if ($c->param("testgroup")) {
$testgroup = Litmus::DB::Testgroup->retrieve($c->param("testgroup"));
if (! $product) {
$product = $testgroup->product();
}
}
my $vars;
@ -219,9 +186,8 @@ $vars->{'title'} = 'Run Tests';
my $cookie = Litmus::Auth::getCookie();
$vars->{"defaultemail"} = $cookie;
$vars->{"show_admin"} = Litmus::Auth::istrusted($cookie);
$vars->{"test_runs"} = [$test_run];
$vars->{'testcount'} = $testcount;
$vars->{'product'} = $product || undef;
$vars->{'resultcounts'} = \%resultcounts || undef;
$vars->{'testgroup'} = $testgroup || undef;
$vars->{'return'} = $c->param("return") || undef;
@ -229,3 +195,17 @@ $vars->{'return'} = $c->param("return") || undef;
Litmus->template()->process("process/process.html.tmpl", $vars) ||
internalError(Litmus->template()->error());
if ($Litmus::Config::DEBUG) {
my $elapsed = tv_interval ( $t0 );
printf "<div id='pageload'>Page took %f seconds to load.</div>", $elapsed;
}
exit 0;
# END
#########################################################################
sub redirectToRunTests() {
my $c = Litmus->cgi();
print $c->redirect("http://127.0.0.1/run_tests.cgi");
}

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

@ -34,12 +34,14 @@ our $t0 = [gettimeofday];
use Litmus;
use Litmus::Error;
use Litmus::FormWidget;
use Litmus::DB::Product;
use Litmus::UserAgentDetect;
use Litmus::SysConfig;
use Litmus::Auth;
use CGI;
use JSON;
use Time::Piece::MySQL;
Litmus->init();
@ -48,79 +50,123 @@ our $title = "Run Tests";
our $c = Litmus->cgi();
if ($c->param("group")) { # display the test screen
&page_test();
} elsif ($c->param("platform") || $c->param("continuetesting")) { # pick a group
&page_pickGroupSubgroup();
} else { # need to setup their system config
&page_sysSetup();
if ($c->param) {
if ($c->param("testgroup")) {
&displayTestcases();
} elsif ($c->param("criterion") or
$c->param("continuetesting")) {
&displayGroupSelection();
} elsif ($c->param("test_run_id")) {
&displaySysConfig();
} else {
&displayAllTestRuns();
}
} else {
&displayAllTestRuns();
}
if ($Litmus::Config::DEBUG) {
my $elapsed = tv_interval ( $t0 );
printf "<div id='pageload'>Page took %f seconds to load.</div>", $elapsed;
}
exit 0;
# END
#########################################################################
# a menu for the user to enter their platform information
sub page_sysSetup {
print $c->header();
# sometimes the user will have already selected their product
my $productid = $c->param("product");
my $product = undef;
if ($productid) {
$product = Litmus::DB::Product->retrieve($productid);
unless ($product) {
invalidInputError("Invalid product selection: $productid");
}
}
Litmus::SysConfig->displayForm($product, "run_tests.cgi");
exit;
}
# the user has selected their system information and now needs to pick
# an area to test:
sub page_pickGroupSubgroup {
my $sysconfig;
my $product = Litmus::DB::Product->retrieve($c->param("product"));
if (! $product) {
print $c->header();
invalidInputError("Invalid product ".$c->param("product"));
}
my $branch;
if ($c->param("continuetesting")) {
# they have already gotten setup and just want to
# pick a new group or subgroup:
$sysconfig = Litmus::SysConfig->getCookie($product);
if (!$sysconfig) {
page_pickProduct()
};
$branch = $sysconfig->branch();
} else {
$branch = Litmus::DB::Branch->retrieve($c->param("branch"));
if (! $branch) {
print $c->header();
invalidInputError("Invalid branch ".$c->param("branch"));
}
$sysconfig = Litmus::SysConfig->processForm($c);
# get the user id and set a sysconfig cookie
$c->storeCookie($sysconfig->setCookie());
}
sub displaySysConfig() {
Litmus::Auth::requireLogin("run_tests.cgi");
my $test_run_id = $c->param("test_run_id");
if (!$test_run_id) {
&displayAllTestRuns();
}
print $c->header();
# Get all groups for the current branch.
my @groups = Litmus::DB::Testgroup->search_EnabledByBranch($branch->branch_id());
my $test_run = Litmus::DB::TestRun->getTestRunWithRefs($test_run_id);
my $title = "Run Tests - Your Chosen Test Run";
my $platforms = Litmus::FormWidget->getPlatforms();
my $opsyses = Litmus::FormWidget->getOpsyses();
my $locales = Litmus::FormWidget->getLocales();
my $json = JSON->new(skipinvalid => 1, convblessed => 1);
my $test_run_js = $json->objToJson($test_run);
my $platforms_js = $json->objToJson($platforms);
my $opsyses_js = $json->objToJson($opsyses);
my $vars = {
title => $title,
user => Litmus::Auth::getCurrentUser(),
test_run => [$test_run],
test_run_js => $test_run_js,
platforms_js => $platforms_js,
opsyses_js => $opsyses_js,
locales => $locales,
};
my $cookie = Litmus::Auth::getCookie();
$vars->{"defaultemail"} = $cookie;
$vars->{"show_admin"} = Litmus::Auth::istrusted($cookie);
Litmus->template()->process("runtests/sysconfig.html.tmpl", $vars) ||
internalError(Litmus->template()->error());
}
#########################################################################
sub displayGroupSelection() {
Litmus::Auth::requireLogin("run_tests.cgi");
my $test_run_id = $c->param("test_run_id");
if (!$test_run_id) {
&displayAllTestRuns();
return;
}
my $test_run = Litmus::DB::TestRun->getTestRunWithRefs($test_run_id);
my $sysconfig;
if ($c->param("continuetesting")) {
# Check that we have config info for this test run already.
$sysconfig = Litmus::SysConfig->getCookieByTestRunId($test_run_id);
} else {
$sysconfig = &verifySysConfig($test_run);
}
if (!$sysconfig) {
&displaySysConfig();
return;
};
$c->storeCookie($sysconfig->setCookie());
$test_run->flagCriteriaInUse($sysconfig);
print $c->header();
my $user = Litmus::Auth::getCookie();
my @testgroups;
if (Litmus::Auth::istrusted($user)) {
@testgroups = Litmus::DB::Testgroup->search_ByTestRun($test_run_id);
} else {
@testgroups = Litmus::DB::Testgroup->search_EnabledByTestRun($test_run_id);
}
# all possible subgroups per group:
my %subgroups;
foreach my $curgroup (@groups) {
my @subgroups = Litmus::DB::Subgroup->search_EnabledByTestgroup($curgroup->testgroup_id());
$subgroups{$curgroup->testgroup_id()} = \@subgroups;
foreach my $testgroup (@testgroups) {
my @component_subgroups;
if (Litmus::Auth::istrusted($user)) {
@component_subgroups = Litmus::DB::Subgroup->search_ByTestgroup($testgroup->testgroup_id());
} else {
@component_subgroups = Litmus::DB::Subgroup->search_EnabledByTestgroup($testgroup->testgroup_id());
}
$subgroups{$testgroup->testgroup_id()} = \@component_subgroups;
}
my $defaultgroup = "";
@ -132,37 +178,53 @@ sub page_pickGroupSubgroup {
my $vars = {
title => $title,
user => Litmus::Auth::getCurrentUser(),
opsys => $sysconfig->opsys(),
groups => \@groups,
test_runs => [$test_run],
testgroups => \@testgroups,
subgroups => \%subgroups,
sysconfig => $sysconfig,
defaultgroup => $defaultgroup,
defaultemail => $user,
show_admin => Litmus::Auth::istrusted($user),
sysconfig => $sysconfig,
};
my $cookie = Litmus::Auth::getCookie();
$vars->{"defaultemail"} = $cookie;
$vars->{"show_admin"} = Litmus::Auth::istrusted($cookie);
Litmus->template()->process("runtests/selectgroupsubgroup.html.tmpl",
$vars) ||
internalError(Litmus->template()->error());
if ($Litmus::Config::DEBUG) {
my $elapsed = tv_interval ( $t0 );
printf "<div id='pageload'>Page took %f seconds to load.</div>", $elapsed;
}
$vars) or
internalError(Litmus->template()->error());
}
# display a page of testcases:
sub page_test {
#########################################################################
sub displayTestcases() {
Litmus::Auth::requireLogin("run_tests.cgi");
my $test_run_id = $c->param("test_run_id");
if (!$test_run_id) {
&displayAllTestRuns();
}
my $test_run = Litmus::DB::TestRun->getTestRunWithRefs($test_run_id);
my $sysconfig = Litmus::SysConfig->getCookieByTestRunId($test_run_id);
if (!$sysconfig) {
&displaySysConfig();
return;
};
$c->storeCookie($sysconfig->setCookie());
$test_run->flagCriteriaInUse($sysconfig);
print $c->header();
# use Data::Dumper;
# print Dumper $sysconfig;
# print Dumper $test_run->{'criteria'};
# the form has a subgroup radio button set for each possible group, named
# subgroup_n where n is the group id number. We get the correct
# subgroup based on whatever group the user selected:
my $testgroup_id = $c->param("group");
my $testgroup_id = $c->param("testgroup");
my $subgroup_id = $c->param("subgroup_".$testgroup_id);
print $c->header();
my $cookie = Litmus::Auth::getCookie();
my $show_admin = Litmus::Auth::istrusted($cookie);
@ -174,24 +236,120 @@ sub page_test {
@tests = Litmus::DB::Testcase->search_CommunityEnabledBySubgroup($subgroup_id,$testgroup_id);
}
my $sysconfig = Litmus::SysConfig->getCookie($tests[0]->product());
my $vars = {
title => $title,
sysconfig => $sysconfig,
group => Litmus::DB::Testgroup->retrieve($testgroup_id),
subgroup => Litmus::DB::Subgroup->retrieve($subgroup_id),
tests => \@tests,
title => $title,
test_runs => [$test_run],
testgroup => Litmus::DB::Testgroup->retrieve($testgroup_id),
subgroup => Litmus::DB::Subgroup->retrieve($subgroup_id),
tests => \@tests,
defaultemail => $cookie,
show_admin => $show_admin,
istrusted => $show_admin,
sysconfig => $sysconfig,
};
Litmus->template()->process("runtests/testdisplay.html.tmpl", $vars) ||
internalError(Litmus->template()->error());
if ($Litmus::Config::DEBUG) {
my $elapsed = tv_interval ( $t0 );
printf "<div id='pageload'>Page took %f seconds to load.</div>", $elapsed;
}
}
#########################################################################
sub displayAllTestRuns() {
print $c->header();
my @recommended_test_runs = Litmus::DB::TestRun->getTestRuns(1,'true',0);
my @remaining_test_runs = Litmus::DB::TestRun->getTestRuns(1,'false',0);
my $title = "Active Test Runs - All";
my $vars = {
title => $title,
user => Litmus::Auth::getCurrentUser(),
recommended_test_runs => \@recommended_test_runs,
remaining_test_runs => \@remaining_test_runs,
};
my $cookie = Litmus::Auth::getCookie();
$vars->{"defaultemail"} = $cookie;
$vars->{"show_admin"} = Litmus::Auth::istrusted($cookie);
Litmus->template()->process("runtests/all_test_runs.tmpl",
$vars) ||
internalError(Litmus->template()->error());
}
#########################################################################
sub verifySysConfig() {
my ($test_run) = @_;
# Use the criterion value as the basis for our check, since disabled form
# controls don't dubmit their values anyway.
my ($row_num,$build_id,$platform_id,$opsys_id);
if ($c->param("criterion")) {
($row_num,$build_id,$platform_id,$opsys_id) = split(/\|/,$c->param("criterion"),4);
if (!$build_id) {
$build_id = $c->param("build_id_${row_num}");
}
if (!$platform_id) {
$platform_id = $c->param("platform_${row_num}");
}
if (!$opsys_id) {
$opsys_id = $c->param("opsys_${row_num}");
}
}
my $locale = $c->param("locale");
# Make sure we have a complete set of criteria.
if (!$build_id or
!$platform_id or
!$opsys_id or
!$locale) {
return undef;
}
# Compare the provided criteria with any required criteria.
my $found_match = 0;
if ($test_run->criteria and scalar(@{$test_run->criteria}) > 0) {
foreach my $criterion (@{$test_run->criteria}) {
# Build ID alone is the smallest possible criteria set.
if ($criterion->{'build_id'} == $build_id) {
if ($criterion->{'platform_id'}) {
if ($criterion->{'platform_id'} == $platform_id) {
if ($criterion->{'opsys_id'}) {
if ($criterion->{'opsys_id'} == $opsys_id) {
# Matches build ID, platform ID, and opsys ID
$found_match = 1;
last;
}
next;
}
# Matches build ID and platform ID
$found_match = 1;
last;
}
next;
}
# Matches build ID.
$found_match = 1;
last;
}
next;
}
} else {
# No criteria associated with this test run, so any complete set of
# criteria will do.
$found_match = 1;
}
if (!$found_match) {
return undef;
}
my $sysconfig = Litmus::SysConfig::new(
$test_run->{'test_run_id'},
$build_id,
$platform_id,
$opsys_id,
$locale
);
return $sysconfig;
}

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

@ -42,13 +42,11 @@ Litmus->init();
my $c = Litmus->cgi();
print $c->header();
my $criteria = "Custom<br/>";
my $results;
my @where;
my @order_by;
my $limit;
my $limit = $Litmus::DB::Testresult::_num_results_default;
my $where_criteria = "";
my $order_by_criteria = "";
my $limit_criteria = "";
@ -83,11 +81,21 @@ if ($c->param) {
push @where, {field => $param,
value => $value};
$where_criteria .= "Platform is \'".$c->param($param)."\'<br/>";
} elsif ($param eq 'test_group') {
my $value = quotemeta($c->param($param));
} elsif ($param eq 'test_run_id') {
my $value = $c->param($param);
push @where, {field => $param,
value => $value};
$where_criteria .= "Test group is \'".$c->param($param)."\'<br/>";
$where_criteria .= "Test Run ID# is \'".$c->param($param)."\'<br/>";
} elsif ($param eq 'testgroup' or $param eq 'test_group') {
my $value = $c->param($param);
push @where, {field => $param,
value => $value};
$where_criteria .= "Testgroup is \'".$c->param($param)."\'<br/>";
} elsif ($param eq 'subgroup') {
my $value = $c->param($param);
push @where, {field => $param,
value => $value};
$where_criteria .= "Subgroup is \'".$c->param($param)."\'<br/>";
} elsif ($param eq 'testcase_id') {
my $value = quotemeta($c->param($param));
push @where, {field => $param,

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

@ -53,14 +53,18 @@ $vars->{'default_num_days'} = Litmus::DB::Testcase->getDefaultNumDays();
$vars->{'default_relevance_threshold'} = Litmus::DB::Testcase->getDefaultRelevanceThreshold();
my $products = Litmus::FormWidget->getProducts($show_admin);
my $branches = Litmus::FormWidget->getBranches($show_admin);
my $testgroups = Litmus::FormWidget->getTestgroups($show_admin);
my $subgroups = Litmus::FormWidget->getSubgroups($show_admin,'sort_order');
my $json = JSON->new(skipinvalid => 1, convblessed => 1);
my $products_js = $json->objToJson($products);
my $branches_js = $json->objToJson($branches);
my $testgroups_js = $json->objToJson($testgroups);
my $subgroups_js = $json->objToJson($subgroups);
$vars->{'products_js'} = $products_js;
$vars->{'branches_js'} = $branches_js;
$vars->{'testgroups_js'} = $testgroups_js;
$vars->{'subgroups_js'} = $subgroups_js;
@ -147,7 +151,7 @@ if ($c->param("id")) {
my $showallresults = $c->param("showallresults") || "";
my @where;
push @where, { field => 'testcase_id', value => $testcase_id };
push @where, { field => 'testcase', value => $testcase_id };
my @order_by;
push @order_by, { field => 'created', direction => 'DESC' };
my $test_results = Litmus::DB::Testresult->getTestResults(\@where,\@order_by);

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

@ -25,7 +25,7 @@
# ***** END LICENSE BLOCK *****
#%]
[% INCLUDE global/html_header.tmpl js_files=['js/prototype.lite.js','js/moo.fx.js','js/moo.fx.pack.js','js/FormValidation.js','js/EditCategories.js','js/MochiKit/MochiKit.js','js/json.js','js/Help.js','js/SelectBoxes.js','js/SelectSort.js','js/ManageCategories.js','js/ManageTestdays.js'] %]
[% INCLUDE global/html_header.tmpl js_files=['js/prototype.lite.js','js/moo.fx.js','js/moo.fx.pack.js','js/FormValidation.js','js/EditCategories.js','js/MochiKit/MochiKit.js','js/json.js','js/Help.js','js/SelectBoxes.js','js/SelectSort.js','js/ManageCategories.js'] %]
[% INCLUDE global/litmus_header.tmpl %]
<script type="text/javascript">
@ -45,7 +45,6 @@ var testgroups=[% testgroups_js %];
[% INCLUDE admin/form_widgets/update_platforms.tmpl %]
[% INCLUDE admin/form_widgets/update_opsyses.tmpl %]
[% INCLUDE admin/form_widgets/update_branches.tmpl %]
[% INCLUDE admin/form_widgets/update_testdays.tmpl %]
</div> <!--END content-->
@ -54,7 +53,6 @@ var testgroups=[% testgroups_js %];
Element.cleanWhitespace('manage_platforms_div');
Element.cleanWhitespace('manage_opsyses_div');
Element.cleanWhitespace('manage_branches_div');
Element.cleanWhitespace('manage_testdays_div');
ec_init();
</script>

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

@ -29,29 +29,29 @@
# $subgroup - the subgroup object to show
#%]
<form id="edit_subgroup_form" name="edit_subgroup_form" method="post" action="manage_subgroups.cgi" onSubmit="selectNone('editform_testcases_for_product');selectAll('editform_subgroup_testcases');return checkFormContents(this);">
<input id="editform_mode" name="editform_mode" type="hidden" value="edit">
<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="">
<table class="manage">
<tr>
<td class="headerleft">Subgroup ID#:</td>
<td name="editform_subgroup_id_display" id="editform_subgroup_id_display"></td>
<td name="subgroup_id_display" id="subgroup_id_display"></td>
</tr>
<tr>
<td class="headerleft">Name:</td>
<td><input name="editform_name"
id="editform_name"
<td><input name="name"
id="name"
value=""
size="35"/ disabled></td>
</tr>
<tr>
<td class="headerleft">Product:</td>
<td>[% INCLUDE form_widgets/select_product_id.tmpl name="editform_product" placeholder=1 size=1 onchange="changeProduct();populateBranches(document.getElementById('editform_product'));populateAllTestcases();" %]</td>
<td>[% INCLUDE form_widgets/select_product_id.tmpl name="product" placeholder=1 size=1 display_id=1 onchange="changeProduct();populateBranches(document.getElementById('branch'),document.getElementById('product'));populateAllTestcases();" %]</td>
</tr>
<tr>
<td class="headerleft">Branch:</td>
<td>[% INCLUDE form_widgets/select_branch_id.tmpl name="editform_branch" placeholder=1 size=1 onchange="populateAllTestcases();" %]</td>
<td>[% INCLUDE form_widgets/select_branch_id.tmpl name="branch" placeholder=1 size=1 display_id=1 onchange="populateAllTestcases();" %]</td>
</tr>
<tr>
<td class="headerleft">Test Group(s):</td>
@ -62,17 +62,17 @@
<tr>
<td class="headerleft">Enabled?</td>
<td>
<input name="editform_enabled"
<input name="enabled"
type="checkbox"
id="editform_enabled"
id="enabled"
value="1" disabled
onchange="if (this.checked == false) {document.getElementById('editform_communityenabled').checked =false;}">
onchange="if (this.checked == false) {document.getElementById('communityenabled').checked =false;}">
</td>
<td>&lArr;&nbsp;Uncheck this to completely disable this subgroup.</td>
</tr>
<tr>
<td class="headerleft">Testrunner Group ID#:</td>
<td name="editform_testrunner_group_id" id="editform_testrunner_group_id"></td>
<td name="testrunner_group_id" id="testrunner_group_id"></td>
</tr>
<tr>
<td colspan="3"><hr/></td>
@ -85,24 +85,24 @@
<div class="manage">
<table border="0" cellspacing="10" cellpadding="0">
<tr>
<td id="editform_testcases_for_product_header" name="editform_testcases_for_product_header" class="headerleft">All Testcases For Product/Branch</td>
<td id="testcases_for_product_header" name="testcases_for_product_header" class="headerleft">All Testcases For Product/Branch</td>
<td></td>
<td class="headerleft">Testcases in Subgroup</td>
</tr>
<tr>
<td><select multiple class="testcase-subgroups" id="editform_testcases_for_product" name="editform_testcases_for_product" size="15">
<td><select multiple class="testcase-subgroups" id="testcases_for_product" name="testcases_for_product" size="15">
<option value="">--No product selected--</option>
</select></td>
<td align="center" valign="middle"><input id="add_testcase_button" name="add_testcase_button" type="button" value="&rArr;" onClick="copyToList('editform_testcases_for_product','editform_subgroup_testcases');"><br/><br/><input id="remove_testcase_button" name="remove_testcase_button" type="button" value="&lArr;" onClick="removeSelectedFromList('editform_subgroup_testcases',true);"></td>
<td><select multiple class="testcase-subgroups" id="editform_subgroup_testcases" name="editform_subgroup_testcases" size="15">
<td align="center" valign="middle"><input id="add_testcase_button" name="add_testcase_button" type="button" value="&rArr;" onClick="copyToList('testcases_for_product','subgroup_testcases');"><br/><br/><input id="remove_testcase_button" name="remove_testcase_button" type="button" value="&lArr;" onClick="removeSelectedFromList('subgroup_testcases',true);"></td>
<td><select multiple class="testcase-subgroups" id="subgroup_testcases" name="subgroup_testcases" size="15">
<option value="">--No subgroup selected--</option>
</select></td>
<td align="center" valign="middle"><input id="move_testcase_up_button" name="move_testcase_up_button" type="button" value="&uArr;" onClick="up('editform_subgroup_testcases');"><br/><br/><input id="move_testcase_down_button" name="move_testcase_down_button" type="button" value="&dArr;" onClick="down('editform_subgroup_testcases');"></td>
<td align="center" valign="middle"><input id="move_testcase_up_button" name="move_testcase_up_button" type="button" value="&uArr;" onClick="up('subgroup_testcases');"><br/><br/><input id="move_testcase_down_button" name="move_testcase_down_button" type="button" value="&dArr;" onClick="down('subgroup_testcases');"></td>
</tr>
<tr>
<td align="right">&uArr;&nbsp;<a name="previewTestcase" onclick="previewTestcase('editform_testcases_for_product');">Preview Testcase</a></td>
<td align="right">&uArr;&nbsp;<a name="previewTestcase" onclick="previewTestcase('testcases_for_product');">Preview Testcase</a></td>
<td></td>
<td align="right">&uArr;&nbsp;<a name="previewTestcase" onclick="previewTestcase('editform_subgroup_testcases');">Preview Testcase</a></td>
<td align="right">&uArr;&nbsp;<a name="previewTestcase" onclick="previewTestcase('subgroup_testcases');">Preview Testcase</a></td>
<td></td>
</tr>
<tr>
@ -114,7 +114,7 @@
</td>
</tr>
<tr>
<td colspan="3" align="right"><input id="editform_reset" class="button" type="button" value="Reset" disabled onClick="resetSubgroup();" />&nbsp;<input class="button" type="submit" id="editform_submit" name="editform_submit" value="Submit Edits" disabled /></div>
<td colspan="3" align="right"><input id="reset" class="button" type="button" value="Reset" disabled onClick="resetSubgroup();" />&nbsp;<input class="button" type="submit" id="submit" name="submit" value="Submit Edits" disabled /></div>
</td>
</tr>
</table>

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

@ -0,0 +1,197 @@
[%# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1
#
# 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 Litmus.
#
# The Initial Developer of the Original Code is
# The Mozilla Corporation.
# Portions created by the Initial Developer are Copyright (C) 2006
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
# Chris Cooper <ccooper@deadsquid.com>
# Zach Lipton <zach@zachlipton.com>
#
# ***** END LICENSE BLOCK *****
#%]
[%# INTERFACE:
# $test_run - the test_run object to show
#%]
<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="">
<table class="manage">
<tr>
<td class="headerleft">Test Run ID#:</td>
<td name="test_run_id_display" id="test_run_id_display"></td>
</tr>
<tr>
<td class="headerleft">Name:</td>
<td><input name="name"
id="name"
value=""
size="35"/ disabled></td>
</tr>
<tr>
<td class="headerleft">Description:</td>
<td><textarea name="description"
id="description"
cols="40" rows="3" disabled></textarea></td>
</tr>
<tr>
<td class="headerleft">Product:</td>
<td>[% INCLUDE form_widgets/select_product_id.tmpl name="product" placeholder=1 multiple=0 size=1 display_id=1 onchange="changeProduct();populateBranches(document.getElementById('branch'),document.getElementById('product'));populateAllTestgroups();" %]</td>
</tr>
<tr>
<td class="headerleft">Branch:</td>
<td>[% INCLUDE form_widgets/select_branch_id.tmpl name="branch" placeholder=1 multiple=0 size=1 display_id=1 onchange="populateAllTestgroups();" %]</td>
</tr>
<tr>
<td class="headerleft">Start Timestamp:</td>
<td><input name="start_timestamp"
id="start_timestamp"
value=""
size="35"/ disabled></td>
<td>&lArr;&nbsp;YYYYMMDDHHmmSS</td>
</tr>
<tr>
<td class="headerleft">Finish Timestamp:</td>
<td><input name="finish_timestamp"
id="finish_timestamp"
value=""
size="35"/ disabled></td>
<td>&lArr;&nbsp;YYYYMMDDHHmmSS</td>
</tr>
<tr>
<td class="headerleft">Author:</td>
<td>[% INCLUDE form_widgets/select_author.tmpl name="author_id" disabled=1 placeholder=1 display_id=1 %]
</tr>
<tr>
<td class="headerleft">Enabled?</td>
<td>
<input name="enabled"
type="checkbox"
id="enabled"
value="1" disabled>
</td>
<td>&lArr;&nbsp;Uncheck this to completely disable this test run.</td>
</tr>
<tr>
<td class="headerleft">Recommended?</td>
<td>
<input name="recommended"
type="checkbox"
id="recommended"
value="1" disabled>
</td>
<td>&lArr;&nbsp;Recommended test runs will be displayed preferentially in the Mozilla Recommends... section.</td>
</tr>
<tr>
<td class="headerleft">Creation Date:</td>
<td name="creation_date" id="creation_date"></td>
</tr>
<tr>
<td class="headerleft">Last Updated:</td>
<td name="last_updated" id="last_updated"></td>
</tr>
<tr>
<td class="headerleft">Version #:</td>
<td name="version" id="version"></td>
</tr>
<tr>
<td colspan="3"><hr/></td>
</tr>
<tr>
<td class="headerleft" colspan="3">Manage Test Run Criteria</td>
</tr>
<tr>
<td colspan="3">
<div class="manage">
<table class="newCriteria" id="tblNewCriteria" name="tblNewCriteria" border="0" cellspacing="10" cellpadding="0">
<tr>
<td class="headerleft">Build ID#</td>
<td class="headerleft">Platform</td>
<td class="headerleft">Operating System</td>
</tr>
<tr>
<td><input id="build_id_new_1" name="build_id_new_1" type="text" size="10" /></td>
<td>[% INCLUDE form_widgets/select_platform_id.tmpl name="platform_new_1" placeholder=1 size=1 show_name=1 display_id=1 onchange="changePlatform('_new_1');" %]</td>
<td>[% INCLUDE form_widgets/select_opsys_id.tmpl name="opsys_new_1" placeholder=1 size=1 show_name=1 display_id=1 classname="select_opsys" %]</td>
<td><input type="button" class="button" onclick="removeRowFromTable('tblNewCriteria');" value="-" /></td>
<td><input type="button" class="button" onclick="addRowToTable('tblNewCriteria');" value="+" /></td>
</tr>
</table>
</div>
</td>
</tr>
<tr>
<td colspan="3"><hr/></td>
</tr>
<tr>
<td class="headerleft" colspan="3">Manage Testgroups for this Test Run</td>
</tr>
<tr>
<td colspan="3">
<div class="manage">
<table border="0" cellspacing="10" cellpadding="0" width="100%">
<tr>
<td id="testgroups_for_product_header" name="testgroups_for_product_header" class="headerleft">All Testgroups For Product/Branch</td>
<td></td>
<td class="headerleft">Testgroups in Test Run</td>
</tr>
<tr>
<td><select multiple class="testgroup-test-runs" id="testgroups_for_product" name="testgroups_for_product" size="15">
<option value="">--No Product/Branch selected--</option>
</select></td>
<td align="center" valign="middle"><input id="add_testgroup_button" name="add_testgroup_button" type="button" value="&rArr;" onClick="copyToList('testgroups_for_product','test_run_testgroups');"><br/><br/><input id="remove_testgroup_button" name="remove_testgroup_button" type="button" value="&lArr;" onClick="removeSelectedFromList('test_run_testgroups',true);"></td>
<td><select multiple class="testgroup-test-runs" id="test_run_testgroups" name="test_run_testgroups" size="15">
<option value="">--No Test Run selected--</option>
</select></td>
<td align="center" valign="middle"><input id="move_testgroup_up_button" name="move_testgroup_up_button" type="button" value="&uArr;" onClick="up('test_run_testgroups');"><br/><br/><input id="move_testgroup_down_button" name="move_testgroup_down_button" type="button" value="&dArr;" onClick="down('test_run_testgroups');"></td>
</tr>
<tr>
<td align="right">&uArr;&nbsp;<a name="previewTestgroup" onclick="previewTestgroup('testgroups_for_product');">Preview Testgroup</a></td>
<td></td>
<td align="right">&uArr;&nbsp;<a name="previewTestgroup" onclick="previewTestgroup('test_run_testgroups');">Preview Testgroup</a></td>
<td></td>
</tr>
<tr>
<td colspan="3" align="right">&uArr;&nbsp;<a name="showManageTestgroupsHelp" onclick="toggleHelp(manageTestgroupsHelpTitle,manageTestgroupsHelpText);">Help with Managing Testgroups</a></td>
<td></td>
</tr>
</table>
</div>
</td>
</tr>
<tr>
<td colspan="3" align="right"><input id="reset" class="button" type="button" value="Reset" disabled onClick="resetTestRun();" />&nbsp;<input class="button" type="submit" id="submit" name="submit" value="Submit Edits" disabled /></div>
</td>
</tr>
</table>
</form>

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

@ -32,18 +32,18 @@
[% INCLUDE test/formattingHelp.js.tmpl %]
<form id="edit_testcase_form" name="edit_testcase_form" method="post" action="manage_testcases.cgi" onSubmit="return checkFormContents(this);">
<input id="editform_mode" name="editform_mode" type="hidden" value="edit">
<input id="mode" name="mode" type="hidden" value="edit">
<input id="editform_testcase_id" name="editform_testcase_id" type="hidden" value="">
<table class="manage">
<tr>
<td class="headerleft">Testcase ID#:</td>
<td name="editform_testcase_id_display" id="editform_testcase_id_display"></td>
<td name="testcase_id_display" id="testcase_id_display"></td>
</tr>
<tr>
<td class="headerleft">Summary:</td>
<td colspan="2"><input name="editform_summary"
id="editform_summary"
<td colspan="2"><input name="summary"
id="summary"
value=""
size="55"/ disabled></td>
</tr>
@ -53,19 +53,19 @@
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="50%" class="headerleft">Steps to Perform:<br/>
<textarea name="editform_steps"
id="editform_steps"
<textarea name="steps"
id="steps"
rows="10" cols="40" disabled></textarea>
</td>
<td width="50%" class="headerleft">Expected Results:<br/>
<textarea name="editform_results"
id="editform_results"
<textarea name="results"
id="results"
rows="10" cols="40" disabled></textarea>
</td>
</tr>
<tr>
<td align="right">&uArr;&nbsp;<a name="stepsPreview" onClick="var newwin = window.open('preview.cgi?preview=' + escape(document.getElementById('editform_steps').value),'preview_window','height=400,width=400,resizeable=yes,scrollable=yes');newwin.focus();">Preview</a></td>
<td align="right">&uArr;&nbsp;<a name="resultsPreview" onClick="var newwin = window.open('preview.cgi?preview=' + escape(document.getElementById('editform_results').value),'preview_window','height=400,width=400,resizeable=yes,scrollable=yes');newwin.focus();">Preview</a></td>
<td align="right">&uArr;&nbsp;<a name="stepsPreview" onClick="var newwin = window.open('preview.cgi?preview=' + escape(document.getElementById('steps').value),'preview_window','height=400,width=400,resizeable=yes,scrollable=yes');newwin.focus();">Preview</a></td>
<td align="right">&uArr;&nbsp;<a name="resultsPreview" onClick="var newwin = window.open('preview.cgi?preview=' + escape(document.getElementById('results').value),'preview_window','height=400,width=400,resizeable=yes,scrollable=yes');newwin.focus();">Preview</a></td>
</tr>
<tr>
<td colspan="2" align="right">&uArr;&nbsp;<a name="showFormattingHelp" onclick="toggleHelp(formattingHelpTitle,formattingHelpText);">Formatting Help</a></td>
@ -77,11 +77,11 @@
<tr>
<td class="headerleft">Product:</td>
<td>[% INCLUDE form_widgets/select_product_id.tmpl name="editform_product" placeholder=1 size=1 onchange="changeProduct();populateBranches(document.getElementById('editform_product'));" %]</td>
<td>[% INCLUDE form_widgets/select_product_id.tmpl name="product" placeholder=1 size=1 display_id=1 onchange="changeProduct();populateBranches(document.getElementById('branch'),document.getElementById('product'));" %]</td>
</tr>
<tr>
<td class="headerleft">Branch:</td>
<td>[% INCLUDE form_widgets/select_branch_id.tmpl name="editform_branch" placeholder=1 size=1 %]</td>
<td>[% INCLUDE form_widgets/select_branch_id.tmpl name="branch" placeholder=1 size=1 display_id=1 %]</td>
<tr>
<td class="headerleft">Test Group(s):</td>
<td colspan="2">
@ -98,59 +98,59 @@
<tr>
<td class="headerleft">Enabled?</td>
<td>
<input name="editform_enabled"
<input name="enabled"
type="checkbox"
id="editform_enabled"
id="enabled"
value="1" disabled
onchange="if (this.checked == false) {document.getElementById('editform_communityenabled').checked =false;}">
onchange="if (this.checked == false) {document.getElementById('communityenabled').checked =false;}">
</td>
<td>&lArr;&nbsp;Uncheck this to completely disable this testcase.</td>
</tr>
<tr>
<td class="headerleft">Community Enabled?</td>
<td>
<input name="editform_communityenabled"
<input name="communityenabled"
type="checkbox"
id="editform_communityenabled"
id="communityenabled"
value="1" disabled
onchange="if (this.checked == true) {document.getElementById('editform_enabled').checked =true;}">
onchange="if (this.checked == true) {document.getElementById('enabled').checked =true;}">
</td>
<td>&lArr;&nbsp;Uncheck this to disable this testcase for the community-at-large.<br/>Note: trusted testers will still be able to see and run this testcase.</td>
</tr>
<tr>
<td class="headerleft">Regression Bug ID#:</td>
<td><input name="editform_regression_bug_id"
<td><input name="regression_bug_id"
type="text"
id="editform_regression_bug_id"
id="regression_bug_id"
value="" disabled>
</td>
</tr>
<tr>
<td class="headerleft">Author:</td>
<td>[% INCLUDE form_widgets/select_author.tmpl name="editform_author_id" disabled=1 placeholder=1 %]
<td>[% INCLUDE form_widgets/select_author.tmpl name="author_id" disabled=1 placeholder=1 %]
</tr>
<tr>
<td class="headerleft">Creation Date:</td>
<td name="editform_creation_date" id="editform_creation_date"></td>
<td name="creation_date" id="creation_date"></td>
</tr>
<tr>
<td class="headerleft">Last Updated:</td>
<td name="editform_last_updated" id="editform_last_updated"></td>
<td name="last_updated" id="last_updated"></td>
</tr>
<tr>
<td class="headerleft">Litmus Version:</td>
<td name="editform_litmus_version" id="editform_litmus_version"></td>
<td name="litmus_version" id="litmus_version"></td>
</tr>
<tr>
<td class="headerleft">Testrunner Case ID#:</td>
<td name="editform_testrunner_case_id" id="editform_testrunner_case_id"></td>
<td name="testrunner_case_id" id="testrunner_case_id"></td>
</tr>
<tr>
<td class="headerleft">Testrunner Case Version:</td>
<td name="editform_testrunner_case_version" id="editform_testrunner_case_version"></td>
<td name="testrunner_case_version" id="testrunner_case_version"></td>
</tr>
<tr>
<td colspan="3" align="right"><input id="editform_reset" class="button" type="button" value="Reset" disabled onClick="resetTestcase();" />&nbsp;<input class="button" type="submit" id="editform_submit" name="editform_submit" value="Submit Edits" disabled /></div>
<td colspan="3" align="right"><input id="reset" class="button" type="button" value="Reset" disabled onClick="resetTestcase();" />&nbsp;<input class="button" type="submit" id="submit" name="submit" value="Submit Edits" disabled /></div>
</td>
</tr>
</table>

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

@ -29,43 +29,43 @@
# $testgroup - the testgroup object to show
#%]
<form id="edit_testgroup_form" name="edit_testgroup_form" method="post" action="manage_testgroups.cgi" onSubmit="selectNone('editform_subgroups_for_product');selectAll('editform_testgroup_subgroups');return checkFormContents(this);">
<input id="editform_mode" name="editform_mode" type="hidden" value="edit">
<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="">
<table class="manage">
<tr>
<td class="headerleft">Testgroup ID#:</td>
<td name="editform_testgroup_id_display" id="editform_testgroup_id_display"></td>
<td name="testgroup_id_display" id="testgroup_id_display"></td>
</tr>
<tr>
<td class="headerleft">Name:</td>
<td><input name="editform_name"
id="editform_name"
<td><input name="name"
id="name"
value=""
size="35"/ disabled></td>
</tr>
<tr>
<td class="headerleft">Product:</td>
<td>[% INCLUDE form_widgets/select_product_id.tmpl name="editform_product" placeholder=1 size=1 onchange="changeProduct();populateBranches(document.getElementById('editform_product'));populateAllSubgroups();" %]</td>
<td>[% INCLUDE form_widgets/select_product_id.tmpl name="product" placeholder=1 size=1 display_id=1 onchange="changeProduct();populateBranches(document.getElementById('branch'),document.getElementById('product'));populateAllSubgroups();" %]</td>
</tr>
<tr>
<td class="headerleft">Branch:</td>
<td>[% INCLUDE form_widgets/select_branch_id.tmpl name="editform_branch" placeholder=1 size=1 onchange="populateAllSubgroups();" %]</td>
<td>[% INCLUDE form_widgets/select_branch_id.tmpl name="branch" placeholder=1 size=1 display_id=1 onchange="populateAllSubgroups();" %]</td>
</tr>
<tr>
<td class="headerleft">Enabled?</td>
<td>
<input name="editform_enabled"
<input name="enabled"
type="checkbox"
id="editform_enabled"
id="enabled"
value="1" disabled>
</td>
<td>&lArr;&nbsp;Uncheck this to completely disable this testgroup.</td>
</tr>
<tr>
<td class="headerleft">Testrunner Plan ID#:</td>
<td name="editform_testrunner_plan_id" id="editform_testrunner_plan_id"></td>
<td name="testrunner_plan_id" id="testrunner_plan_id"></td>
</tr>
<tr>
<td colspan="3"><hr/></td>
@ -78,24 +78,24 @@
<div class="manage">
<table border="0" cellspacing="10" cellpadding="0">
<tr>
<td id="editform_subgroups_for_product_header" name="editform_subgroups_for_product_header" class="headerleft">All Subgroups For Product/Branch</td>
<td id="subgroups_for_product_header" name="subgroups_for_product_header" class="headerleft">All Subgroups For Product/Branch</td>
<td></td>
<td class="headerleft">Subgroups in Testgroup</td>
</tr>
<tr>
<td><select multiple class="subgroup-testgroups" id="editform_subgroups_for_product" name="editform_subgroups_for_product" size="15">
<td><select multiple class="subgroup-testgroups" id="subgroups_for_product" name="subgroups_for_product" size="15">
<option value="">--No product selected--</option>
</select></td>
<td align="center" valign="middle"><input id="add_subgroup_button" name="add_subgroup_button" type="button" value="&rArr;" onClick="copyToList('editform_subgroups_for_product','editform_testgroup_subgroups');"><br/><br/><input id="remove_subgroup_button" name="remove_subgroup_button" type="button" value="&lArr;" onClick="removeSelectedFromList('editform_testgroup_subgroups',true);"></td>
<td><select multiple class="subgroup-testgroups" id="editform_testgroup_subgroups" name="editform_testgroup_subgroups" size="15">
<td align="center" valign="middle"><input id="add_subgroup_button" name="add_subgroup_button" type="button" value="&rArr;" onClick="copyToList('subgroups_for_product','testgroup_subgroups');"><br/><br/><input id="remove_subgroup_button" name="remove_subgroup_button" type="button" value="&lArr;" onClick="removeSelectedFromList('testgroup_subgroups',true);"></td>
<td><select multiple class="subgroup-testgroups" id="testgroup_subgroups" name="testgroup_subgroups" size="15">
<option value="">--No testgroup selected--</option>
</select></td>
<td align="center" valign="middle"><input id="move_subgroup_up_button" name="move_subgroup_up_button" type="button" value="&uArr;" onClick="up('editform_testgroup_subgroups');"><br/><br/><input id="move_subgroup_down_button" name="move_subgroup_down_button" type="button" value="&dArr;" onClick="down('editform_testgroup_subgroups');"></td>
<td align="center" valign="middle"><input id="move_subgroup_up_button" name="move_subgroup_up_button" type="button" value="&uArr;" onClick="up('testgroup_subgroups');"><br/><br/><input id="move_subgroup_down_button" name="move_subgroup_down_button" type="button" value="&dArr;" onClick="down('testgroup_subgroups');"></td>
</tr>
<tr>
<td align="right">&uArr;&nbsp;<a name="previewSubgroup" onclick="previewSubgroup('editform_subgroups_for_product');">Preview Subgroup</a></td>
<td align="right">&uArr;&nbsp;<a name="previewSubgroup" onclick="previewSubgroup('subgroups_for_product');">Preview Subgroup</a></td>
<td></td>
<td align="right">&uArr;&nbsp;<a name="previewSubgroup" onclick="previewSubgroup('editform_testgroup_subgroups');">Preview Subgroup</a></td>
<td align="right">&uArr;&nbsp;<a name="previewSubgroup" onclick="previewSubgroup('testgroup_subgroups');">Preview Subgroup</a></td>
<td></td>
</tr>
<tr>
@ -107,7 +107,7 @@
</td>
</tr>
<tr>
<td colspan="3" align="right"><input id="editform_reset" class="button" type="button" value="Reset" disabled onClick="resetTestgroup();" />&nbsp;<input class="button" type="submit" id="editform_submit" name="editform_submit" value="Submit Edits" disabled /></div>
<td colspan="3" align="right"><input id="reset" class="button" type="button" value="Reset" disabled onClick="resetTestgroup();" />&nbsp;<input class="button" type="submit" id="submit" name="submit" value="Submit Edits" disabled /></div>
</td>
</tr>
</table>

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

@ -22,11 +22,8 @@
# $user - the user object to edit
#%]
[% PROCESS global/selects.none.tmpl %]
[% includeselects=1 %]
[% INCLUDE global/html_header.tmpl js_files=['js/SelectBoxes.js','js/FormValidation.js']
title='Edit User' %]
[% INCLUDE global/html_header.tmpl js_files=['js/SelectBoxes.js','js/FormValidation.js'] title='Edit User' %]
[% INCLUDE global/litmus_header.tmpl %]
<script type="text/javascript">

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

@ -22,11 +22,8 @@
# $users - iterator for the list of users to display
#%]
[% PROCESS global/selects.none.tmpl %]
[% includeselects=1 %]
[% INCLUDE global/html_header.tmpl js_files=['js/SelectBoxes.js']
title='Edit Users' %]
[% INCLUDE global/html_header.tmpl js_files=['js/SelectBoxes.js'] title='Edit Users' %]
[% INCLUDE global/litmus_header.tmpl %]
<div id="page">

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

@ -22,11 +22,7 @@
#
#%]
[% PROCESS global/selects.none.tmpl %]
[% includeselects=1 %]
[% INCLUDE global/html_header.tmpl js_files=['js/SelectBoxes.js','js/FormValidation.js']
title='Edit Users' %]
[% INCLUDE global/html_header.tmpl js_files=['js/SelectBoxes.js','js/FormValidation.js'] title='Edit Users' %]
[% INCLUDE global/litmus_header.tmpl %]
<div id="page">

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

@ -22,11 +22,7 @@
# $user - the edited user object
#%]
[% PROCESS global/selects.none.tmpl %]
[% includeselects=1 %]
[% INCLUDE global/html_header.tmpl js_files=['js/SelectBoxes.js','js/FormValidation.js']
title='Edit User' %]
[% INCLUDE global/html_header.tmpl js_files=['js/SelectBoxes.js','js/FormValidation.js'] title='Edit User' %]
[% INCLUDE global/litmus_header.tmpl %]
<div id="page">

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

@ -1,4 +1,4 @@
<h1 id="testdays_header" class="firstHeading"><a name="manage_testdays" class="collapse-link">Manage Testdays&nbsp;&raquo;</a></h1>
<h1 id="testdays_header" class="firstHeading">Manage Testdays</h1>
<div id="manage_testdays_div" class="collapsable">
<div class="section-full">
@ -6,7 +6,7 @@
<div class="section-content">
<form id="select_testday_and_mode_form" name="select_testday_and_mode_form" method="post" action="manage_categories.cgi">
<form id="select_testday_and_mode_form" name="select_testday_and_mode_form" method="post" action="manage_testdays.cgi">
<table border="0" cellspacing="0" cellpadding="5">
<tr>
<td>
@ -30,7 +30,7 @@
<hr />
<div id="testday-title" class="section-header">Testday Info</div>
<div class="section-content">
<form id="edit_testday_form" name="edit_testday_form" method="post" action="manage_categories.cgi" onSubmit="return checkTestdayForm(this);">
<form id="edit_testday_form" name="edit_testday_form" method="post" action="manage_testdays.cgi" onSubmit="return checkTestdayForm(this);">
<input id="edit_testday_form_mode" name="edit_testday_form_mode" type="hidden" value="edit">
<input id="edit_testday_form_testday_id" name="edit_testday_form_testday_id" type="hidden" value="">
@ -64,25 +64,25 @@
</tr>
<tr>
<td class="headerleft">Product:</td>
<td colspan="2">[% INCLUDE form_widgets/select_product_id.tmpl name="testday_product_id" placeholder=1 onchange="changeProduct(this,document.getElementById('testday_branch_id'),document.getElementById('testday_testgroup_id'));" %]</td>
<td colspan="2">[% INCLUDE form_widgets/select_product_id.tmpl name="product" placeholder=1 onchange="changeProduct();" %]</td>
</tr>
<tr>
<td class="headerleft">Branch:</td>
<td>[% INCLUDE form_widgets/select_branch_id.tmpl name="testday_branch_id" placeholder=1 onchange="changeBranch(this,document.getElementById('testday_testgroup_id'));" %]</td>
<td>[% INCLUDE form_widgets/select_branch_id.tmpl name="branch" placeholder=1 onchange="changeBranch();" %]</td>
<td>&lArr; Select Product first</td>
</tr>
<tr>
<td class="headerleft">Testgroup:</td>
<td>[% INCLUDE form_widgets/select_testgroup_id.tmpl name="testday_testgroup_id" placeholder=1 %]</td>
<td>[% INCLUDE form_widgets/select_testgroup_id.tmpl name="testgroup" placeholder=1 %]</td>
<td>&lArr; Select Branch first</td>
</tr>
<tr>
<td class="headerleft">Build ID:</td>
<td><input name="testday_build_id" id="testday_build_id" type="text" size="10"></td>
<td><input name="build_id" id="build_id" type="text" size="10"></td>
</tr>
<tr>
<td class="headerleft">Locale:</td>
<td>[% INCLUDE form_widgets/select_locale.tmpl name="testday_locale" placeholder=1 %]
<td>[% INCLUDE form_widgets/select_locale.tmpl name="locale" placeholder=1 %]
</tr>
<tr>
@ -94,5 +94,9 @@
</div>
</div>
<script type="text/javascript">
formName='edit_testday_form';
</script>
</div> <!--end section-full-->
</div>

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

@ -29,8 +29,13 @@
[% INCLUDE global/litmus_header.tmpl %]
<script type="text/javascript">
var testcases=[% IF all_testcases %][% all_testcases %][% ELSE %]{}[% END %];
var current_user_id=[% user.user_id %];
var formName='select_subgroup_and_mode_form';
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 testcases=[% IF testcases_js %][% testcases_js %][% ELSE %]{}[% END %];
</script>
<div id="page">
@ -52,14 +57,18 @@ var current_user_id=[% user.user_id %];
<table border="0">
<tr>
<td>Product:</td>
<td>Branch:</td>
<td>Testgroup:</td>
</tr>
<tr>
<td>
[% INCLUDE form_widgets/select_product_id.tmpl name="product_filter" placeholder=1 size=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');filterList();" %]
</td>
<td>
[% INCLUDE form_widgets/select_branch_id.tmpl name="branch_filter" placeholder=1 size=1 display_id=1 onchange="changeBranch('_filter');filterList();" %]
</td>
<td>
[% INCLUDE form_widgets/select_testgroup_id.tmpl name="testgroup_filter" placeholder=1 size=1 onchange="changeTestgroup('filter');filterList();" %]
[% INCLUDE form_widgets/select_testgroup_id.tmpl name="testgroup_filter" placeholder=1 size=1 display_id=1 onchange="filterList();" %]
</td>
</tr>
</table>
@ -67,7 +76,7 @@ var current_user_id=[% user.user_id %];
<table border="0" cellspacing="0" cellpadding="5">
<tr>
<td>
[% INCLUDE form_widgets/select_subgroup_id.tmpl name="subgroup_id" placeholder=1 size=10 onchange="loadSubgroup();" %]
[% INCLUDE form_widgets/select_subgroup_id.tmpl name="subgroup_id" placeholder=1 size=10 display_id=1 onchange="loadSubgroup();" %]
</td>
</tr>
<tr>

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

@ -0,0 +1,126 @@
[%# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1
#
# 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 Litmus.
#
# The Initial Developer of the Original Code is
# The Mozilla Corporation.
# Portions created by the Initial Developer are Copyright (C) 2006
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
# Chris Cooper <ccooper@deadsquid.com>
# Zach Lipton <zach@zachlipton.com>
#
# ***** END LICENSE BLOCK *****
#%]
[% INCLUDE global/html_header.tmpl js_files=['js/FormValidation.js','js/MochiKit/MochiKit.js','js/json.js','js/Help.js','js/SelectBoxes.js','js/SelectSort.js','js/ManageTestRuns.js'] %]
[% INCLUDE global/litmus_header.tmpl %]
<script type="text/javascript">
var current_user_id=[% user.user_id %];
var formName='select_test_run_and_mode_form';
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 platforms=[% IF platforms_js %][% platforms_js %][% ELSE %]{}[% END %];
var opsyses=[% IF opsyses_js %][% opsyses_js %][% ELSE %]{}[% END %];
</script>
<div id="page">
[% INCLUDE sidebar/sidebar.tmpl %]
<div id="content">
<h1 class="firstHeading">[% title %]</h1>
<div class="section-full">
<div class="section-header">Existing Test Runs</div>
<div class="section-content">
<form id="select_test_run_and_mode_form" name="select_test_run_and_mode_form" method="post" action="manage_test_runs.cgi">
<b>Filter:</b>
<table border="0">
<tr>
<td>Product:</td>
<td>Branch:</td>
</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();" %]
</td>
<td>
[% INCLUDE form_widgets/select_branch_id.tmpl name="branch_filter" placeholder=1 size=1 display_id=1 onchange="filterList();" %]
</td>
</tr>
</table>
<table border="0" cellspacing="0" cellpadding="5">
<tr>
<td>
[% INCLUDE form_widgets/select_test_run_id.tmpl name="test_run_id" placeholder=1 size=10 show_summary=1 display_id=1 onchange="loadTestRun();" %]
</td>
</tr>
<tr>
<td>
<input id="add_test_run_button" name="add_test_run_button" class="manage" type="button" onClick="switchToAdd();" value="Add New Test Run">&nbsp;
<input id="edit_test_run_button" name="edit_test_run_button" class="manage" type="button" onClick="switchToEdit();" value="Edit Test Run" disabled>&nbsp;
<input id="clone_test_run_button" name="clone_test_run_button" class="manage" type="submit" onClick="return confirm('Really clone this test run?');" value="Clone Test Run" disabled>&nbsp;
<input id="delete_test_run_button" name="delete_test_run_button" class="manage" type="submit" onClick="return confirm('Really delete this test run?');" value="Delete Test Run" disabled>&nbsp;
</td>
</tr>
</table>
</form>
</div> <!--end section-content-->
</div> <!--end section-full-->
<div style="display: none;" id="test_run_display_div" class="section-full"> <div id="test_run-title" class="section-header">Test Run Info</div>
<div class="section-content">
<div class="test_run-content">
[% INCLUDE test_run/test_run.tmpl test_run=test_run show_config=1 show_edit=1 %]
</div>
</div>
</div>
<div style="display: none;" id="editform_div" class="section-full">
<div id="test_run-title" class="section-header">Test Run Info</div>
<div class="section-content">
[% INCLUDE admin/edit_test_run.tmpl %]
</div> <!--end section-content-->
</div> <!--end section-full-->
</div> <!--END content-->
</div> <!--END page-->
<script type="text/javascript">
var em = document.getElementById('test_run_id');
if (em.selectedIndex >= 0) {
loadTestRun();
enableForm('edit_test_run_form');
} else {
disableForm('edit_test_run_form');
}
</script>
[% INCLUDE global/litmus_footer.tmpl %]
[% INCLUDE global/html_footer.tmpl %]

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

@ -30,6 +30,11 @@
<script type="text/javascript">
var current_user_id=[% user.user_id %];
var formName='select_testcase_and_mode_form';
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 %];
</script>
<div id="page">
@ -51,18 +56,22 @@ var current_user_id=[% user.user_id %];
<table border="0">
<tr>
<td>Product:</td>
<td>Branch:</td>
<td>Testgroup:</td>
<td>Subgroup:</td>
</tr>
<tr>
<td>
[% INCLUDE form_widgets/select_product_id.tmpl name="product_filter" placeholder=1 size=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');filterList();" %]
</td>
<td>
[% INCLUDE form_widgets/select_testgroup_id.tmpl name="testgroup_filter" placeholder=1 size=1 onchange="changeTestgroup('filter');filterList()\;" %]
[% INCLUDE form_widgets/select_branch_id.tmpl name="branch_filter" placeholder=1 size=1 display_id=1 onchange="changeBranch('_filter');filterList();" %]
</td>
<td>
[% INCLUDE form_widgets/select_subgroup_id.tmpl name="subgroup_filter" placeholder=1 size=1 onchange="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');filterList();" %]
</td>
<td>
[% INCLUDE form_widgets/select_subgroup_id.tmpl name="subgroup_filter" placeholder=1 size=1 display_id=1 onchange="filterList();" %]
</td>
</tr>
</table>
@ -111,6 +120,7 @@ var current_user_id=[% user.user_id %];
</div> <!--END page-->
<script type="text/javascript">
loadProducts(document.getElementById('product_filter'),'_filter',1);
var em = document.getElementById('testcase_id');
if (em.selectedIndex >= 0) {
[% IF edit %]

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

@ -29,8 +29,11 @@
[% INCLUDE global/litmus_header.tmpl %]
<script type="text/javascript">
var subgroups=[% IF all_subgroups %][% all_subgroups %][% ELSE %]{}[% END %];
var current_user_id=[% user.user_id %];
var formName='select_testgroup_and_mode_form';
var products=[% IF products_js %][% products_js %][% ELSE %]{}[% END %];
var branches=[% IF branches_js %][% branches_js %][% ELSE %]{}[% END %];
var subgroups=[% IF subgroups_js %][% subgroups_js %][% ELSE %]{}[% END %];
</script>
<div id="page">
@ -53,10 +56,14 @@ var current_user_id=[% user.user_id %];
<table border="0">
<tr>
<td>Product:</td>
<td>Branch:</td>
</tr>
<tr>
<td>
[% INCLUDE form_widgets/select_product_id.tmpl name="product_filter" placeholder=1 size=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');filterList();" %]
</td>
<td>
[% INCLUDE form_widgets/select_branch_id.tmpl name="branch_filter" placeholder=1 size=1 display_id=1 onchange="filterList();" %]
</td>
</tr>
</table>

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

@ -1,9 +1,9 @@
<select class="select_branch" id="[% name %]" name="[% name %]"[% IF size %] size="[% size %]"[% END %][% IF disabled %] disabled[% END %][% IF onchange %] onchange="[% onchange %]"[% END %][% IF multiple %] multiple[% END %]>
[% IF placeholder %]<option value="">-Branch-</option>[% END %]
[% IF placeholder %]<option value="">-Branch[% IF display_id %] (ID#)[% END %]-</option>[% END %]
[% IF branches %]
[% FOREACH branch=branches %]
<option[% IF defaults.branch==branch.name %] selected[% END %]
value="[% branch.branch_id | html %]">[% branch.name | html %] ([% branch.branch_id %])</option>
value="[% branch.branch_id | html %]">[% branch.name | html %][% IF display_id %] ([% branch.branch_id %])[% END %]</option>
[% END %]
[% END %]
</select>

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

@ -1,7 +1,6 @@
<select id="[% name %]" name="[% name %]"[% IF size %] size="[% size %]"[% END %][% IF disabled %] disabled[% END %][% IF onchange %] onchange="[% onchange %]"[% END %]>
[% IF placeholder %]<option value="">-Locale-</option>[% END %]
[% IF locales %]
[% IF ! defaults.locale %][% defaults.locale = "en-US" %][% END %]
[% FOREACH locale=locales %]
<option[% IF defaults.locale==locale.abbrev %] selected[% END %]
value="[% locale.abbrev | html %]">[% locale.abbrev | html %]</option>

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

@ -1,4 +1,4 @@
<select name="[% name | html %]">
<select id="[% name %]" name="[% name | html %]">
[% IF match_criteria %]
[% FOREACH match_criterion=match_criteria %]
<option value="[% match_criterion.name | html %]">

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

@ -7,11 +7,11 @@
[% IF onchange %] onchange="[% onchange %]"[% END %]
[% IF multiple %] multiple[% END %]>
[% IF placeholder %]<option value="">-Operating System-</option>[% END %]
[% IF placeholder %]<option value="">-Operating System[% IF display_id %] (ID#)[% END %]-</option>[% END %]
[% IF opsyses %]
[% FOREACH opsys=opsyses %]
<option[% IF defaults.opsys==opsys.name %] selected[% END %]
value="[% opsys.opsys_id | html %]">[% opsys.name | html %] ([% opsys.opsys_id %])</option>
value="[% opsys.opsys_id | html %]">[% opsys.name | html %][% IF display_id %] ([% opsys.opsys_id %])[% END %]</option>
[% END %]
[% END %]
</select>

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

@ -5,11 +5,11 @@
[% IF disabled %] disabled[% END %]
[% IF onchange %] onchange="[% onchange %]"[% END %]>
[% IF placeholder %]<option value="">-Platform-</option>[% END %]
[% IF placeholder %]<option value="">-Platform[% IF display_id %] (ID#)[% END %]-</option>[% END %]
[% IF platforms %]
[% FOREACH platform=platforms %]
<option[% IF defaults.platform==platform.name %] selected[% END %]
value="[% platform.platform_id | html %]">[% platform.name | html %] ([% platform.platform_id %])</option>
value="[% platform.platform_id | html %]">[% platform.name | html %][% IF display_id %] ([% platform.platform_id %])[% END %]</option>
[% END %]
[% END %]
</select>

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

@ -5,7 +5,7 @@
[% IF disabled %] disabled[% END %]
[% IF onchange %] onchange="[% onchange %]"[% END %]
[% IF multiple %] multiple[% END %]>
[% IF placeholder %]<option value="">-Product-</option>[% END %]
[% IF placeholder %]<option value="">-Product[% IF display_id %] (ID#)[% END %]-</option>[% END %]
[% IF products %]
[% FOREACH product=products %]
<option[% IF defaults.product==product.name %] selected[% END %]

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

@ -1,10 +1,10 @@
<select name="[% name %]"[% IF size %] size="[% size %]"[% END %][% IF disabled %] disabled[% END %]>
<select id="[% name %]" name="[% name %]"[% IF size %] size="[% size %]"[% END %][% IF disabled %] disabled[% END %]>
[% IF placeholder %]<option value="">-Status-</option>[% END %]
[% IF result_statuses %]
[% FOREACH result_status=result_statuses %]
<option[% IF defaults.result_status==result_status.class_name %]
selected[% END %] value="[% result_status.class_name | html %]">
[% result_status.class_name | html %]</option>
[% result_status.name | html %]</option>
[% END %]
[% END %]
</select>

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

@ -4,12 +4,12 @@
[% IF size %] size="[% size %]"[% END %]
[% IF onchange %] onchange="[% onchange %]"[% END %]
[% IF disabled %] disabled[% END %]>
[% IF placeholder %]<option value="">-Subgroup-</option>[% END %]
[% IF placeholder %]<option value="">-Subgroup[% IF display_id %] (ID#)[% END %]-</option>[% END %]
[% IF subgroups %]
[% FOREACH subgroup=subgroups %]
[% subgroup.subgroup_id %]<br/>
<option[% IF defaults.subgroup_id==subgroup.subgroup_id %] selected[% END %]
value="[% subgroup.subgroup_id | html %]">[% subgroup.name %]</option>
value="[% subgroup.subgroup_id | html %]">[% subgroup.name %][% IF display_id %] ([% subgroup.subgroup_id %])[% END %]</option>
[% END %]
[% END %]
</select>

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

@ -0,0 +1,12 @@
<select class="test_run" id="[% name %]" name="[% name %]"[% IF size %] size="[% size %]"[% END %][% IF onchange %] onchange="[% onchange %]"[% END %][% IF disabled %] disabled[% END %]>
[% IF placeholder %]<option value="">-Test Run Name (ID#)-</option>[% END %]
[% IF test_runs %]
[% FOREACH test_run=test_runs %]
<option[% IF defaults.test_run_id==test_run.test_run_id %] selected[% END %]
value="[% test_run.test_run_id | html %]"
id="[%name%]_test_run_[%test_run.test_run_id | html %]">
[% test_run.name %][% IF display_id %] ([% test_run.test_run_id | html%])[% END %]</option>
[% END %]
</select>
[% END %]

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

@ -4,7 +4,7 @@
[% IF size %] size="[% size %]"[% END %]
[% IF onchange %] onchange="[% onchange %]"[% END %]
[% IF disabled %] disabled[% END %]>
[% IF placeholder %]<option value="">-Testcase ID#[% IF show_summary %]: Summary[% END %]-</option>[% END %]
[% IF placeholder %]<option value="">-ID#[% IF show_summary %]: Testcase Summary[% END %]-</option>[% END %]
[% IF testcases %]
[% FOREACH testcase=testcases %]

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

@ -4,11 +4,11 @@
[% IF size %] size="[% size %]"[% END %]
[% IF onchange %] onchange="[% onchange %]"[% END %]
[% IF disabled %] disabled[% END %]>
[% IF placeholder %]<option value="">-Testgroup-</option>[% END %]
[% IF placeholder %]<option value="">-Testgroup[% IF display_id %] (ID#)[% END %]-</option>[% END %]
[% IF testgroups %]
[% FOREACH testgroup=testgroups %]
<option[% IF defaults.testgroup_id==testgroup.testgroup_id %] selected[% END %]
value="[% testgroup.testgroup_id | html %]">[% testgroup.name %]</option>
value="[% testgroup.testgroup_id | html %]">[% testgroup.name %][% IF display_id %] ([% testgroup.testgroup_id %])[% END %]</option>
[% END %]
[% END %]
</select>

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

@ -1,4 +1,4 @@
<select name="timespan">
<select id="timespan" name="timespan">
<option value="">-Timespan-</option>
<option[% IF defaults.timespan=="all" %] selected[% END %] value="all">All Results</option>
<option[% IF defaults.timespan=="-1" %] selected[% END %] value="-1">In the last day</option>

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

@ -25,34 +25,25 @@
# ***** END LICENSE BLOCK *****
#%]
[% INCLUDE global/html_header.tmpl js_files=['js/Help.js'] %]
[% INCLUDE global/html_header.tmpl js_files=['js/Help.js','js/prototype.lite.js','js/json.js','js/MochiKit/MochiKit.js','js/TestRunCoverage.js','js/RunTests.js'] %]
[% INCLUDE global/litmus_header.tmpl %]
[% commenticon="<img class=icon src=\"images/comment.png\" title=\"This result has comments\" alt=\"*\">" %]
<script type="text/javascript">
var navigationHelpTitle = "Navigation";
var navigationHelpText = '<ul class="instructions"><li>Click on the number in the "result id#" column to see a full listing of the test result, including comments.</li><li>Click on the number at the start of the "testcase id#: summary" column to see a more detailed description of that particular testcase.</li><li>Results marked with the comment icon ([% commenticon %]) have comments associated with them. Clicking on the icon will display the comments in-page.</li></ul>';
</script>
<div id="page">
[% INCLUDE sidebar/sidebar.tmpl %]
<div id="content">
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr><td valign="middle"><h1 class="firstHeading">Recent Test Results</h1><td>
<td align="right" valign="middle">&nbsp;&lArr;&nbsp;<a name="showNavigationHelpText" onclick="toggleHelp(navigationHelpTitle,navigationHelpText);">Navigation</a>
</td>
</tr>
</table>
[% INCLUDE reporting/test_results.tmpl %]
[% INCLUDE instructions/what_is_litmus.tmpl %]
[% INCLUDE runtests/test_run_detail.tmpl show_footer=1 display_title_link=1 %]
</div> <!--END content-->
</div> <!--END page-->
<script type="text/javascript">
beginCoverageLookup();
</script>
[% INCLUDE global/litmus_footer.tmpl %]
[% INCLUDE global/html_footer.tmpl %]

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

@ -37,7 +37,8 @@
# from the current group
#%]
[% INCLUDE global/html_header.tmpl %]
[% test_run=test_runs.0 %]
[% INCLUDE global/html_header.tmpl js_files=['js/prototype.lite.js','js/moo.fx.js','js/moo.fx.pack.js','js/RunTests.js','js/json.js','js/MochiKit/MochiKit.js','js/TestRunCoverage.js'] %]
[% INCLUDE global/litmus_header.tmpl %]
<div id="page">
@ -46,21 +47,29 @@
<div id="content">
<h1 class="firstHeading">[% title | html %]</h1>
[% INCLUDE instructions/continue_testing.tmpl %]
<h1 class="firstHeading"><a title="Click to display details of your chosen Test Run." onclick="testConfigHeight.toggle('height');" name="test_run_details">Run Tests - Your Chosen Test Run&nbsp;&raquo;</a></h1>
<div id="test_run_summary">
[% INCLUDE reporting/test_run_summary.tmpl active_test_runs=test_runs display_title_link=0 %]
</div>
<hr/>
<h1 class="firstHeading">Test results submitted</h1>
<div class="section-center">
<div class="section-full">
<div class="section-header">
Results submitted
</div>
<div class="section-content">
<p>Thank you for your testing efforts.</p>
<p>
[% IF testcount %]
[% IF testcount > 1 %] [% plural = 's' %] [% END %]
<p>You have submitted <strong>[% testcount FILTER html %]</strong>
test result[% plural | html %].</p>
You have submitted <strong>[% testcount FILTER html %]</strong>
test result[% plural | html %].
[% END %]
Thank you for your testing efforts.</p>
[% IF resultcounts.keys.0 %]
<p><strong>Result Summary:</strong></p>
@ -89,11 +98,16 @@ Results submitted
</table>
[% END %]
<p>
[% IF return %]
<a href="[% return | html | uri %]">Go Back</a> or
[% END %]
<a href="run_tests.cgi?product=[% product.productid | html | uri %]&continuetesting=1[% IF testgroup %]&defaulttestgroup=[% testgroup.testgroup_id | html | uri %][% END %]">Run Some More Tests</a>
<hr/>
<p><strong>Where to now?</strong></p>
<ul class="test_run_nav">
<li><a href="run_tests.cgi?test_run_id=[% test_run.test_run_id %]&amp;continuetesting=1[% IF testgroup %]&amp;defaulttestgroup=[% testgroup.testgroup_id | html | uri %][% END %]">Continue testing this Test Run under the same configuration.[% IF test_run.recommended %]<img class="inline" alt="*" src="images/yellowstar.gif" / title="Mozilla needs help testing this right now" />[% END %]</a></li>
<li><a href="run_tests.cgi?test_run_id=[% test_run.test_run_id %]">Continue testing this Test Run, but change my configuration.</a></li>
<li><a href="run_tests.cgi">Select a new Test Run to test.</a></li>
<li><a href="test_run_report.cgi?test_run_id=[% test_run.test_run_id %]">Show me the report for this Test Run.</a></li>
<li><a href="index.cgi">Back to the Litmus main page.</a></li>
</ul>
</p>
</div> <!--END section-content-->
@ -102,6 +116,12 @@ Results submitted
</div> <!--END content-->
<script type="text/javascript">
testConfigHeight = new fx.Height('test_run_summary', {duration: 400});
testConfigHeight.toggle();
beginCoverageLookup();
</script>
</div> <!--END page-->
[% INCLUDE global/litmus_footer.tmpl %]

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

@ -0,0 +1,134 @@
[%# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1
#
# 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 Litmus.
#
# The Initial Developer of the Original Code is
# The Mozilla Corporation.
# Portions created by the Initial Developer are Copyright (C) 2006
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
# Chris Cooper <ccooper@deadsquid.com>
# Zach Lipton <zach@zachlipton.com>
#
# ***** END LICENSE BLOCK *****
#%]
[%# INTERFACE:
# no interface for this template
#%]
[% test_run=test_runs.0 %]
[% INCLUDE global/html_header.tmpl js_files=['js/prototype.lite.js',
'js/moo.fx.js',
'js/moo.fx.pack.js',
'js/RunTests.js',
'js/json.js',
'js/MochiKit/MochiKit.js',
'js/TestRunCoverage.js'
] %]
[% INCLUDE global/litmus_header.tmpl %]
<div id="page">
[% INCLUDE sidebar/sidebar.tmpl results=[1] %]
<div id="content">
<h1 class="firstHeading"><a title="Click to display details of your chosen Test Run." onclick="testConfigHeight.toggle('height');" name="test_run_details">Test Run Report - Test Run ID# [% test_run.test_run_id %]&nbsp;&raquo;</a></h1>
<div id="test_run_summary">
[% INCLUDE reporting/test_run_summary.tmpl active_test_runs=test_runs display_title_link=0 %]
</div>
<hr/>
<table class="test_run_report">
<tr>
<td><strong>Criteria</strong></td>
[% FOREACH criterion=test_run.criteria %]
<th>[% criterion.build_id || "" %]<br/>
[% criterion.platform_name || "Any Platform" %]<br/>
[% criterion.opsys_name || "Any OS" %]
</th>
[% END %]
</tr>
[% FOREACH testgroup=testgroups %]
<tr>
<td class="testgroup" colspan="[% sysconfigs.size + 1 %]">Testgroup: [% testgroup.name %]</td>
</tr>
[% FOREACH subgroup=subgroups.${testgroup.testgroup_id} %]
<tr>
<td class="subgroup" colspan="[% sysconfigs.size + 1 %]">Subgroup: [% subgroup.name %]</td>
</tr>
[% FOREACH testcase=testcases.${subgroup.subgroup_id} %]
[% classname="pass" %]
[% all_configs_tested=1 %]
[% all_configs_pass=1 %]
[% FOREACH sysconfig=sysconfigs %]
[% IF ! testcase_coverage.${testcase.testcase_id}.${sysconfig.id} %]
[% all_configs_tested=0 %]
[% LAST %]
[% ELSE %]
[% any_results_pass=0 %]
[% FOREACH result=testcase_coverage.${testcase.testcase_id}.${sysconfig.id} %]
[% classname=result.status %]
[% IF result.status=="pass" %]
[% any_results_pass=1 %]
[% LAST %]
[% END %]
[% END %]
[% IF ! any_results_pass %]
[% all_configs_pass=0 %]
[% LAST %]
[% END %]
[% END %]
[% END %]
<tr class="[% IF all_configs_tested %][% IF all_configs_pass %]pass[% ELSE %][% classname %][% END %][% ELSE %][% IF not (loop.count % 2) %]even[% ELSE %]odd[% END %][% END %]">
<td>[% testcase.testcase_id %]: [% testcase.summary %]</td>
[% FOREACH sysconfig=sysconfigs %]
[% IF testcase_coverage.${testcase.testcase_id}.${sysconfig.id} %]<td align="center" class="[% classname="fail" %][% FOREACH result=testcase_coverage.${testcase.testcase_id}.${sysconfig.id} %]
[% IF result.status=="pass" %]
[% classname="pass" %]
[% LAST %]
[% ELSE %]
[% classname=result.status= %]
[% END %]
[% END %][% classname%]">[% IF testcase_coverage.${testcase.testcase_id}.${sysconfig.id}.size == 1 %]<a href="single_result.cgi?id=[% testcase_coverage.${testcase.testcase_id}.${sysconfig.id}.0.result_id %]">[% ELSE %]<a href="advanced_search.cgi?test_run_id=[% test_run.test_run_id %]&amp;testcase=[% testcase.testcase_id %]">[% END %][% testcase_coverage.${testcase.testcase_id}.${sysconfig.id}.size %]</a></td>[% ELSE %]<td align="center">0</td>[% END %]
[% END %]
</tr>
[% END %]
[% END %]
[% IF ! loop.last %]
<tr>
<td colspan="[% sysconfigs.size + 1 %]"><hr/></td>
</tr>
[% END %]
[% END %]
</table>
</div> <!--END content-->
<script type="text/javascript">
showAll=0;
testConfigHeight = new fx.Height('test_run_summary', {duration: 400});
beginCoverageLookup();
</script>
</div> <!--END page-->
[% INCLUDE global/litmus_footer.tmpl %]
[% INCLUDE global/html_footer.tmpl %]

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

@ -0,0 +1,96 @@
<table class="test_run_summary">
<tr>
<th class="headerleft">Name</th>
<th>Coverage</th>
<th>Results</th>
</tr>
[% IF active_test_runs.list.size > 0 %]
[% FOREACH active_test_run=active_test_runs %]
[% IF loop.count > 1 %]
<tr><td colspan="3"><hr/></td></tr>
[% END %]
<tr [% IF not (loop.count % 2) %]class="even"[% ELSE %]class="odd"[% END %]>
<td class="name">[% IF display_title_link %]<a title="Click here to join this test run!" href="run_tests.cgi?test_run_id=[% active_test_run.test_run_id %]">[% END %][% active_test_run.name %][% IF active_test_run.recommended %] <img alt="*" src="images/yellowstar.gif" / title="Mozilla needs help testing this right now">[% END %][% IF ! select_criteria %]</a>[% END %]</td>
<td id="coverage_[% active_test_run.test_run_id %]" name="coverage_[% active_test_run.test_run_id %]" class="coverage"><a href="test_run_report.cgi?test_run_id=[% active_test_run.test_run_id %]">Loading...<br/><img src="images/loading.gif" alt="Loading..." class="coverage-loading" /></a></td>
<td class="results" >Pass: <a href="search_results.cgi?test_run_id=[% active_test_run.test_run_id %]&amp;result_status=pass">[% active_test_run.getNumResultsByStatus(1) %]</a> / Fail: <a href="search_results.cgi?test_run_id=[% active_test_run.test_run_id %]&amp;result_status=fail">[% active_test_run.getNumResultsByStatus(2) %]</a> / Unclear: <a href="search_results.cgi?test_run_id=[% active_test_run.test_run_id %]&amp;result_status=unclear">[% active_test_run.getNumResultsByStatus(3) %]</a><br/>
Results with Comments: <a href="search_results.cgi?test_run_id=[% active_test_run.test_run_id %]&amp;has_comments=1">[% active_test_run.getNumResultsWithComments %]</a></td>
</tr>
<tr class="[% IF not (loop.count % 2) %]even[% ELSE %]odd[% END %]">
<td class="criteria" colspan="3">
<table>
<tr>
<td><strong>Description:</strong></td>
<td>[% active_test_run.description || "No further description provided." %]</td>
<tr>
<td><strong>Details:</strong></td>
<td>[% active_test_run.product_id.name %], [% active_test_run.branch_id.name %], [% active_test_run.start_timestamp %] &rArr; [% active_test_run.finish_timestamp %]
</td>
</tr>
<tr>
<td><strong>Testgroups:</strong></td>
<td>
[% IF active_test_run.testgroups %]
[% FOR testgroup=active_test_run.testgroups %]
[% IF ! loop.first %], [%END %][% testgroup.name %]
[% END %]
[% ELSE %]
None
[% END %]
</td>
</tr>
[% criteria=active_test_run.criteria %]
[% IF select_criteria %]
</table>
</td>
</tr>
</table>
[% INCLUDE runtests/select_criteria.tmpl %]
[% ELSE %]
<tr>
<td><strong>Criteria:</strong></td>
[% IF criteria && criteria.list.size > 0 %]
[% FOR criterion=criteria %]
[% IF ! loop.first %]<tr><td></td>[% END %]
<td colspan="2"[% IF criterion.in_use %] class="in_use"[% END %]>
Build ID: [% IF criterion.build_id_from_user %]<em>[% END %][% criterion.build_id%][% IF criterion.build_id_from_user %]</em>[% END %]
[% IF criterion.platform_name %], Platform: [% IF criterion.platform_id_from_user %]<em>[% END %][% criterion.platform_name %][% IF criterion.platform_id_from_user %]</em>[% END %]
[% IF criterion.opsys_name %], Operating System: [% IF criterion.opsys_id_from_user %]<em>[% END %][% criterion.opsys_name %][% END %][% IF criterion.opsys_id_from_user %]</em>[% END %][% END %]</td>
[% IF ! loop.last %]<td><strong>OR</strong></td>[%END %]
</tr>
[% END %]
[% ELSE %]
<td>
No further criteria specified
</td>
</tr>
[% END %]
[% END %]
</table>
</td>
</tr>
[% END %]
[% ELSE %]
<tr>
<td class="no-results" colspan="3">[% IF recommended %]There are no recommended, active test runs.[% ELSE %]There are no active test runs.[% END %]</td>
</tr>
[% END %]
[% IF show_footer %]
<tr>
<td colspan="3" align="right"><a href="run_tests.cgi">View All Available Test Runs</a></td>
</tr>
[% END %]
</table>

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

@ -28,7 +28,7 @@
[%# INTERFACE:
#%]
[% INCLUDE global/html_header.tmpl js_files=['js/prototype.lite.js','js/moo.fx.js','js/moo.fx.pack.js','js/MochiKit/MochiKit.js','js/json.js'] %]
[% INCLUDE global/html_header.tmpl js_files=['js/prototype.lite.js','js/moo.fx.js','js/moo.fx.pack.js','js/MochiKit/MochiKit.js','js/json.js','js/SelectBoxes.js'] %]
[% INCLUDE global/litmus_header.tmpl %]
<div id="page">

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

@ -30,88 +30,24 @@
#%]
<script type="text/javascript">
var products=[% products_js %];
var branches=[% branches_js %];
var testgroups=[% testgroups_js %];
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 %];
function init()
{
populateProductSelect("product_id");
productBox = document.getElementById('product_id');
branchBox = document.getElementById('branch_id');
FormInit(document.forms['testday_report'], document.location.search);
FormInit(document.forms['testevent_report'], document.location.search);
changeProduct(productBox);
FormInit(document.forms['testevent_report'], document.location.search);
changeBranch(branchBox);
FormInit(document.forms['testevent_report'], document.location.search);
function init() {
FormInit(document.forms['testday_report'], document.location.search);
productBox = document.getElementById('product_id');
branchBox = document.getElementById('branch_id');
loadProducts(productBox)
FormInit(document.forms['testevent_report'], document.location.search);
changeProduct();
FormInit(document.forms['testevent_report'], document.location.search);
changeBranch();
FormInit(document.forms['testevent_report'], document.location.search);
}
function populateProductSelect(selectID)
{
if (products) {
var selectBox = document.getElementById(selectID)
selectBox.options.length = 0;
selectBox.options[0] = new Option('-Product-','');
for (var i=0; i<products.length; i++) {
selectBox.options[i+1] = new Option(products[i].name,products[i].product_id);
}
}
}
function changeProduct(productSelectBox)
{
if (productSelectBox.selectedIndex &&
productSelectBox.options[productSelectBox.selectedIndex].value != '') {
var branchSelectBox = document.getElementById('branch_id');
if (branchSelectBox) {
branchSelectBox.options.length = 0;
branchSelectBox.options[0] = new Option('-Branch-','');
var i = 1;
for (var j=0; j<branches.length; j++) {
if (branches[j].product_id == productSelectBox.options[productSelectBox.selectedIndex].value) {
branchSelectBox.options[i] = new Option(branches[j].name,branches[j].branch_id);
i++;
}
}
}
var testgroupSelectBox = document.getElementById('testgroup_id');
if (testgroupSelectBox) {
testgroupSelectBox.options.length = 0;
testgroupSelectBox.options[0] = new Option('-Testgroup-','');
var i = 1;
for (var j=0; j<testgroups.length; j++) {
if (testgroups[j].product_id == productSelectBox.options[productSelectBox.selectedIndex].value) {
testgroupSelectBox.options[i] = new Option(testgroups[j].name,testgroups[j].testgroup_id);
i++;
}
}
}
}
}
function changeBranch(branchSelectBox)
{
if (branchSelectBox.selectedIndex &&
branchSelectBox.options[branchSelectBox.selectedIndex].value != '') {
var testgroupSelectBox = document.getElementById('testgroup_id');
if (testgroupSelectBox) {
testgroupSelectBox.options.length = 0;
testgroupSelectBox.options[0] = new Option('-Testgroup-','');
var i = 1;
for (var j=0; j<testgroups.length; j++) {
if (testgroups[j].branch_id == branchSelectBox.options[branchSelectBox.selectedIndex].value) {
testgroupSelectBox.options[i] = new Option(testgroups[j].name,testgroups[j].testgroup_id);
i++;
}
}
}
}
}
</script>
<div class="section-full">
@ -168,16 +104,16 @@ function changeBranch(branchSelectBox)
</tr>
<tr>
<td>Product:</td>
<td>[% INCLUDE form_widgets/select_product_id.tmpl name="product_id" placeholder=1 onchange="changeProduct(this);" %]</td>
<td>[% INCLUDE form_widgets/select_product_id.tmpl name="product" placeholder=1 onchange="changeProduct();" %]</td>
</tr>
<tr>
<td>Branch:</td>
<td>[% INCLUDE form_widgets/select_branch_id.tmpl name="branch_id" placeholder=1 onchange="changeBranch(this);" %]</td>
<td>[% INCLUDE form_widgets/select_branch_id.tmpl name="branch" placeholder=1 onchange="changeBranch();" %]</td>
<td>&lArr; Select Product first</td>
</tr>
<tr>
<td>Testgroup:</td>
<td>[% INCLUDE form_widgets/select_testgroup_id.tmpl name="testgroup_id" placeholder=1 %]</td>
<td>[% INCLUDE form_widgets/select_testgroup_id.tmpl name="testgroup" placeholder=1 %]</td>
<td>&lArr; Select Branch first</td>
</tr>
<tr>

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

@ -0,0 +1,56 @@
[%# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1
#
# 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 Litmus.
#
# The Initial Developer of the Original Code is
# The Mozilla Corporation.
# Portions created by the Initial Developer are Copyright (C) 2006
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
# Chris Cooper <ccooper@deadsquid.com>
# Zach Lipton <zach@zachlipton.com>
#
# ***** END LICENSE BLOCK *****
#%]
[%# INTERFACE:
#%]
[% INCLUDE global/html_header.tmpl js_files=['js/Help.js','js/prototype.lite.js','js/json.js','js/MochiKit/MochiKit.js','js/TestRunCoverage.js','js/RunTests.js'] %]
[% INCLUDE global/litmus_header.tmpl %]
<script type="text/javascript">
</script>
<div id="page">
[% INCLUDE sidebar/sidebar.tmpl %]
<div id="content">
[% INCLUDE instructions/selecting_a_test_run.tmpl %]
[% INCLUDE runtests/test_run_detail.tmpl title="Active Test Runs - Recommended" active_test_runs=recommended_test_runs recommended=1 display_title_link=1 %]
[% INCLUDE runtests/test_run_detail.tmpl title="Active Test Runs - Remaining" active_test_runs=remaining_test_runs recommended=0 display_title_link=1 %]
</div> <!--END content-->
</div> <!--END page-->
<script type="text/javascript">
beginCoverageLookup();
</script>
[% INCLUDE global/litmus_footer.tmpl %]
[% INCLUDE global/html_footer.tmpl %]

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

@ -0,0 +1,71 @@
<div class="select_criteria">
<form id="select_criteria_form" name="select_criteria_form" method="post" action="run_tests.cgi" onSubmit="return checkFormContents(this);">
<input type="hidden" name="test_run_id" id="test_run_id" value="[% active_test_run.test_run_id %]" />
<table class="criteria" id="tblCriteria" name="tblCriteria" border="0" cellspacing="2" cellpadding="10">
<tr>
[% IF criteria && criteria.list.size > 0 %]
<td class="sectionHeading" colspan="4">Which of the required criteria matches your configuration?</td>
[% ELSE %]
<td class="sectionHeading" colspan="4">Please provide your configuration details:</td>
[% END %]
</tr>
<tr>
<th>Select</td>
<th>Build ID#&nbsp<a name="showBuildIDHelpText" onclick="toggleHelp(buildIDHelpTitle,buildIDHelpText);"><img class="inline" src="images/info.png" alt="How do I determine the build ID?" /></a></td>
<th>Platform</td>
<th>Operating System</td>
</tr>
<tr>
<td colspan="4"><hr /></td>
</tr>
<tr>
<td class="sectionHeading" colspan="4">Extra configuration information:</td>
</tr>
<tr>
<th>Locale</td>
<td colspan="3">[% INCLUDE form_widgets/select_locale.tmpl name="locale" defaults.locale=ua.locale %]</td>
</tr>
<tr>
<td colspan="4"><hr /></td>
</tr>
<tr>
<td colspan="4" align="right"><input class="button" type="button" value="Reset" onClick="resetCriteria();" />&nbsp;<input class="button" type="submit" value="Submit configuration" /></td>
</tr>
</table>
</form>
<script type="text/javascript">
[% IF defaultbuildid %]
appBuildID = "[% defaultbuildid | js | html %]";
[% END %]
getBuildId();
if (test_run.criteria.length > 0) {
for (var i=0; i<test_run.criteria.length; i++) {
addRowToTable('tblCriteria',
i+2,
test_run.criteria[i].build_id,
test_run.criteria[i].platform_id,
test_run.criteria[i].opsys_id
);
}
} else {
addRowToTable('tblCriteria',
2
);
}
</script>
</div>

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

@ -35,13 +35,13 @@
#%]
[% onload = "$onload; showsubgroup();" %]
[% INCLUDE global/html_header.tmpl js_files=['js/prototype.lite.js','js/moo.fx.js','js/moo.fx.pack.js','js/SubGroup.js','js/SelectBoxes.js','js/RunTests.js','js/Help.js'] %]
[% test_run=test_runs.0 %]
[% INCLUDE global/html_header.tmpl js_files=['js/prototype.lite.js','js/moo.fx.js','js/moo.fx.pack.js','js/SubGroup.js','js/SelectBoxes.js','js/RunTests.js','js/Help.js','js/json.js','js/MochiKit/MochiKit.js','js/TestRunCoverage.js'] %]
[% INCLUDE global/litmus_header.tmpl %]
<script type="text/javascript">
var percentagesHelpTitle = 'Percentages explained';
var percentagesHelpText = '<p>The testing coverage percentages are based on Platform (Windows, Mac, Linux) and Build ID. Since the Build ID is datestamp-based, this should mean that there are always some tests that need running if you update to the latest nightly build.</p><p>While we appreciate all testing efforts, it is more helpful if you select a testing group or subgroup for testing that does not already have complete testing coverage by the community.</p><p>If there are problems with an existing test result that you have submitted (e.g. invalid status), please add a comment to the test result in question.</p>';
var percentagesHelpText = '<p>The testing coverage percentages are based on Operating System, Build ID, and Locale. Since the Build ID is datestamp-based, this should mean that there are always some tests that need running if you update to the latest nightly build.</p><p>While we appreciate all testing efforts, it is more helpful if you select a testgroup or subgroup for testing that does not already have complete testing coverage by the community.</p><p>If there are problems with an existing test result that you have submitted (e.g. invalid status), please add a comment to the test result in question.</p>';
</script>
<div id="page">
@ -50,17 +50,25 @@ var percentagesHelpText = '<p>The testing coverage percentages are based on Plat
<div id="content">
<h1 class="firstHeading">[% title | html %]</h1>
[% INCLUDE instructions/group_selection.tmpl %]
[% INCLUDE runtests/testing_config.tmpl sysconfig=sysconfig %]
<h1 class="firstHeading"><a title="Click to display details of your chosen Test Run." onclick="testConfigHeight.toggle('height');" name="test_run_details">Run Tests - Your Chosen Test Run&nbsp;&raquo;</a></h1>
<div class="section-full">
<div id="test_run_summary">
[% INCLUDE reporting/test_run_summary.tmpl active_test_runs=test_runs display_title_link=0 %]
</div>
<hr/>
<h1 class="firstHeading">Select a Testgroup and Subgroup to Test</h1>
<div class="section-center">
<div class="section-header">
Select Testing Group
</div>
<div class="section-content">
<form action="run_tests.cgi" method="post" name="form" id="form">
<input type="hidden" id="test_run_id" name="test_run_id" value="[% test_run.test_run_id %]"/>
<p>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
@ -70,11 +78,11 @@ Select Testing Group
<tr>
<th>Name</th>
[% IF show_admin %]
<th>Trusted Coverage</th>
<th>Trusted Coverage <a name="showPercentagesHelpText" onclick="toggleHelp(percentagesHelpTitle,percentagesHelpText);"><img class="inline" src="images/info.png" alt="Percentages Explained" /></a></th>
[% ELSE %]
<th>Personal Testing Coverage</th>
<th>Personal Testing Coverage <a name="showPercentagesHelpText" onclick="toggleHelp(percentagesHelpTitle,percentagesHelpText);"><img class="inline" src="images/info.png" alt="Percentages Explained" /></a></th>
[% END %]
<th>Community Testing Coverage</th>
<th>Community Testing Coverage <a name="showPercentagesHelpText" onclick="toggleHelp(percentagesHelpTitle,percentagesHelpText);"><img class="inline" src="images/info.png" alt="Percentages Explained" /></a></th>
</tr>
[% IF defaultgroup.testgroup_id=="" %]
@ -82,18 +90,18 @@ Select Testing Group
[% ELSE %]
[% select_first_avail_group=0 %]
[% END %]
[% FOREACH curgroup = groups %]
[% FOREACH testgroup = testgroups %]
[% IF show_admin %]
[% personal_completed = curgroup.coverage(sysconfig.platform, sysconfig.build_id, sysconfig.locale, 0, 0, 1) %]
[% personal_completed = testgroup.coverage(sysconfig.build_id, sysconfig.platform_id, sysconfig.opsys_id, sysconfig.locale, 0, 0, 1) %]
[% ELSE %]
[% personal_completed = curgroup.coverage(sysconfig.platform, sysconfig.build_id, sysconfig.locale, 0, user) %]
[% personal_completed = testgroup.coverage(sysconfig.build_id, sysconfig.platform_id, sysconfig.opsys_id, sysconfig.locale, 0, user) %]
[% END %]
[% IF personal_completed == 100 %]
[% community_completed = 100 %]
[% ELSE %]
[% community_completed = curgroup.coverage(sysconfig.platform, sysconfig.build_id, sysconfig.locale, 0) %]
[% community_completed = testgroup.coverage(sysconfig.build_id, sysconfig.platform_id, sysconfig.opsys_id, sysconfig.locale, 0) %]
[% END %]
[% IF community_completed == 100 OR completed == 'N/A' %]
@ -116,7 +124,7 @@ Select Testing Group
[% IF personal_completed != 100 AND
personal_completed != 'N/A' AND
(defaultgroup.testgroup_id==curgroup.testgroup_id OR
(defaultgroup.testgroup_id==testgroup.testgroup_id OR
select_first_avail_group==1) %]
[% selected = "checked" %]
[% select_first_avail_group=0 %]
@ -124,9 +132,9 @@ Select Testing Group
[% selected = "" %]
[% END %]
<td><input [% IF personal_completed == 'N/A' %]disabled [% END %] type="radio" id="group" name="group" value="[% curgroup.testgroup_id FILTER html %]"
<td><input [% IF personal_completed == 'N/A' %]disabled [% END %] type="radio" id="testgroup" name="testgroup" value="[% testgroup.testgroup_id FILTER html %]"
onClick="showsubgroup()" [% selected | none %]>
[% curgroup.name FILTER html %]</td>
[% testgroup.name FILTER html %]</td>
<td align="center">[% personal_completed FILTER html %][% IF personal_completed != 'N/A' %]%[% END %]</td>
<td align="center">[% community_completed FILTER html %][% IF community_completed != 'N/A' %]%[% END %]</td>
</tr>
@ -136,8 +144,6 @@ Select Testing Group
</td>
<td style="padding-left: 1em;">&lArr; <a name="showPercentagesHelpText" onclick="toggleHelp(percentagesHelpTitle,percentagesHelpText);">Percentages explained</a></td>
</tr>
</table>
@ -145,19 +151,19 @@ Select Testing Group
</div> <!--END section-content-->
</div> <!--END section-full-->
</div> <!--END section-center-->
<div class="section-full">
<div class="section-center">
<div class="section-header">
Select Subgroup
</div>
<div class="section-content">
<p>
[% IF show_admin %]
[% headerrow = '<tr><th>Name</th><th>Number of Tests</th><th>Trusted Coverage</th><th>Community Testing Coverage</th></tr>' %]
[% headerrow = '<tr><th>Name</th><th>Number of Tests</th><th>Trusted Coverage <a name="showPercentagesHelpText" onclick="toggleHelp(percentagesHelpTitle,percentagesHelpText);"><img class="inline" src="images/info.png" alt="Percentages Explained" /></a></th><th>Community Testing Coverage <a name="showPercentagesHelpText" onclick="toggleHelp(percentagesHelpTitle,percentagesHelpText);"><img class="inline" src="images/info.png" alt="Percentages Explained" /></a></th></tr>' %]
[% colspan = 5 %]
[% ELSE %]
[% headerrow = '<tr><th>Name</th><th>Number of Tests</th><th>Personal Testing Coverage</th><th>Community Testing Coverage</th></tr>' %]
[% headerrow = '<tr><th>Name</th><th>Number of Tests</th><th>Personal Testing Coverage <a name="showPercentagesHelpText" onclick="toggleHelp(percentagesHelpTitle,percentagesHelpText);"><img class="inline" src="images/info.png" alt="Percentages Explained" /></a></th><th>Community Testing Coverage <a name="showPercentagesHelpText" onclick="toggleHelp(percentagesHelpTitle,percentagesHelpText);"><img class="inline" src="images/info.png" alt="Percentages Explained" /></a></th></tr>' %]
[% colspan = 4 %]
[% END %]
@ -172,9 +178,9 @@ Please select a testing group with testcases, or that has not yet been tested in
</table>
</div>
[% FOREACH curgroup = subgroups.keys %]
[% cursubgrouplist = subgroups.$curgroup %]
<div id="divsubgroup_[% curgroup FILTER html %]" style="display: none;">
[% FOREACH testgroup = subgroups.keys %]
[% cursubgrouplist = subgroups.$testgroup %]
<div id="divsubgroup_[% testgroup FILTER html %]" style="display: none;">
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td>
@ -184,15 +190,15 @@ Please select a testing group with testcases, or that has not yet been tested in
[% FOREACH cursubgroup = cursubgrouplist %]
[% IF show_admin %]
[% personal_completed = cursubgroup.coverage(sysconfig.platform, sysconfig.build_id, sysconfig.locale, 0, 0, 1) %]
[% personal_completed = cursubgroup.coverage(sysconfig.build_id, sysconfig.platform_id, sysconfig.opsys_id, sysconfig.locale, 0, 0, 1) %]
[% ELSE %]
[% personal_completed = cursubgroup.coverage(sysconfig.platform, sysconfig.build_id, sysconfig.locale, 0, user) %]
[% personal_completed = cursubgroup.coverage(sysconfig.build_id, sysconfig.platform_id, sysconfig.opsys_id, sysconfig.locale, 0, user) %]
[% END %]
[% IF personal_completed == 100 %]
[% community_completed = 100 %]
[% ELSE %]
[% community_completed = cursubgroup.coverage(sysconfig.platform, sysconfig.build_id, sysconfig.locale, 0) %]
[% community_completed = cursubgroup.coverage(sysconfig.build_id, sysconfig.platform_id, sysconfig.opsys_id, sysconfig.locale, 0) %]
[% END %]
[% IF community_completed == 100 OR completed == 'N/A' %]
@ -218,9 +224,9 @@ Please select a testing group with testcases, or that has not yet been tested in
[% END %]
<tr class="[% groupstyle | none %]">
<td align="left"><input [% IF ! counttests %]disabled [% ELSIF select_first_avail_subgroup==1 %][% select_first_avail_subgroup=0 %]checked [% END %]type="radio" name="subgroup_[% curgroup FILTER html %]"
value="[% cursubgroup.id FILTER html %]">
[% cursubgroup.name FILTER html %]</input></td>
<td align="left"><table class="none"><tr><td><input [% IF ! counttests %]disabled [% ELSIF select_first_avail_subgroup==1 %][% select_first_avail_subgroup=0 %]checked [% END %]type="radio" id="subgroup_[% testgroup FILTER html %]" name="subgroup_[% testgroup FILTER html %]"
value="[% cursubgroup.id FILTER html %]" /></td>
<td>[% cursubgroup.name FILTER html %]</td></tr></table></td>
<td align="center">[% IF ! counttests %] 0 [% ELSE %] [% counttests %] [% END %]</td>
<td align="center">[% personal_completed FILTER html %][% IF personal_completed != 'N/A' %]%[% END %]</td>
<td align="center">[% community_completed FILTER html %][% IF community_completed != 'N/A' %]%[% END %]</td>
@ -230,8 +236,6 @@ Please select a testing group with testcases, or that has not yet been tested in
</td>
<td style="padding-left: 1em;">&lArr; <a name="showPercentagesHelpText" onclick="toggleHelp(percentagesHelpTitle,percentagesHelpText);">Percentages explained</a></td>
</tr>
</table>
@ -249,13 +253,13 @@ Please select a testing group with testcases, or that has not yet been tested in
</div> <!--END section-content-->
</div> <!--END section-full-->
</div> <!--END section-center-->
</div> <!--END content-->
<script type="text/javascript">
Element.cleanWhitespace('testconfig');
group_init();
beginCoverageLookup();
</script>
</div> <!--END page-->

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

@ -26,57 +26,15 @@
#%]
[%# INTERFACE:
# @products - list of all possible product objects or just a one element
# list with the product selected by the user
# @platforms - a list of all platform objects for the current product
# %opsyses - a hash of all operating systems, where the key
is the platform number and the value is an array of
operating system objects
# @branches - a list of all branch objects for the current product
# $ua (optional) - Litmus::UserAgentDetect() object for the remote user
# $defaultemail (optional)
# $goto - the action of the <form>
# cgidata (optional) - a CGI object. If provided, the param() data will
# be stored in hidden fields and passed to the
# next script
#%]
[% PROCESS global/selects.none.tmpl %]
[% includeselects=1 %]
[% INCLUDE global/html_header.tmpl js_files=['js/SelectBoxes.js','js/FormValidation.js','js/Help.js'] %]
[% INCLUDE global/html_header.tmpl js_files=['js/Help.js','js/prototype.lite.js','js/json.js','js/MochiKit/MochiKit.js','js/TestRunCoverage.js','js/RunTests.js','js/SelectBoxes.js','js/FormValidation.js'] %]
[% INCLUDE global/litmus_header.tmpl %]
<script type="text/javascript">
function checkFormContents(f) {
return (
checkBuildId(f.build_id)
);
}
var appBuildID = [% IF defaultbuildid %]
"[% defaultbuildid | js | html %]";
[% ELSE %]
"0000000000";
[% END %]
if (navigator.buildID && appBuildID == "0000000000") {
appBuildID=navigator.buildID;
} else if (appBuildID == "0000000000") {
try {
netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
var appInfo = Components.classes["@mozilla.org/xre/app-info;1"]
.getService(Components.interfaces.nsIXULAppInfo);
if(appInfo.appBuildID) {
appBuildID = appInfo.appBuildID;
}
} catch (e) {
// Cascade to the next lookup method.
}
}
var buildIDHelpTitle = 'How do I determine the build ID?';
var buildIDHelpText = '<p>The build ID is a 10-digit number that identifies a Mozilla product build down to the date and hour of the build. By supplying the full, correct build ID, you will be making the job of the Mozilla QA team <em>much</em> easier. There are several different ways to determine the build ID of the build you are testing.</p><ol><li><b>Manually</b>: Provided you have installed Talkback, this is the fail-safe method, and allows you to submit the build ID for products other than the one currently being used to submit the results. The Mozilla Quality Assurance wiki has instructions on <a target="external_link_from_litmus" href="http://wiki.mozilla.org/MozillaQualityAssurance:Build_Ids">how to manually verify the build ID</a>.</li><li><b>Nightly Tester Tools</b>: Available for both Firefox and Thunderbird, the Nightly Tester Tools extension adds a number of useful features for testing Mozilla products. This includes a handy display of the build ID of the running build in the title bar. You can download this extension from <a target="external_link_from_litmus" href="https://addons.mozilla.org/search.php?q=Nightly+Tester+Tools">addons.mozilla.org</a>.</li><li><b>Automatic detection</b>: Litmus has JavaScript code built-in to automatically detect the build ID of the current build, but it relies on <a target="external_link_from_litmus" href="http://www.mozilla.org/projects/security/components/signed-scripts.html#codebase">JavaScript codebase principals</a> to do so. To enable codebase principals, testers must add this line to the prefs.js file in their Mozilla user profile dir, or simply edit the pref directly in <a target="external_link_from_litmus" href="http://kb.mozillazine.org/About:config">about:config</a>:<br/><br/><b><code>user_pref("signed.applets.codebase_principal_support", true);</code></b><br/><br/><b>NOTE</b>: this will only be useful if you are submitting results for the currently running version of Firefox. If you are concerned about the security issues of enabling codebase support, you can <a target="external_link_from_litmus" href="http://www.mozilla.org/projects/security/components/signed-scripts.html#codebase">read more about codebase principals here</a>.</li></ol>';
var test_run=[% IF test_run_js %][% test_run_js %][% ELSE %]{}[% END %];
var platforms=[% IF platforms_js %][% platforms_js %][% ELSE %]{}[% END %];
var opsyses=[% IF opsyses_js %][% opsyses_js %][% ELSE %]{}[% END %];
</script>
<div id="page">
@ -85,100 +43,16 @@ var buildIDHelpText = '<p>The build ID is a 10-digit number that identifies a Mo
<div id="content">
<h1 class="firstHeading">[% title | html %]</h1>
<div class="section-full">
<div class="section-header">
System Information
</div>
<div class="section-content">
<p>To run tests, please enter some information about your system configuration.</p>
<form action="[% goto | html %]" method="post" name="sysconfig_form" id="sysconfig_form" onSubmit="return checkFormContents(this);">
<input name="isSysConfig" type="hidden" value="1">
<input name="testgroup" type="hidden" value="[% testgroup | html %]">
[% # here we see if there is data to include as hidden fields.
# This is used in situations where we have testresults that
# need to get stored, but have to have system configuration taken care
# of first.
%]
[% IF cgidata %]
[% FOREACH curdata = cgidata.param() %]
[% IF curdata == "product" %] [% NEXT %] [% END %]
<input name="[%curdata FILTER html %]" type="hidden"
value="[% cgidata.param(curdata) FILTER html %]">
[% END %]
[% END %]
<table border="0" cellpadding="5">
<tr><td><div align="right">Product:</div></td><td>
[% # either only one product or the user already set it, so just display it %]
[% UNLESS products.1 %]
[% products.0.name FILTER html %]
<select name="product" id="product" class="select_product" style="display: none;">
<option value="[%products.0.productid FILTER html%]" selected>
[%products.0.name FILTER html%]</option>
</select>
<input name="product_default" id="product_default" type="hidden"
value="[%products.0.productid FILTER html%]">
[% ELSE %]
[% # display the product selection list then %]
[% INCLUDE productbox products=products %]
[% END %]
</td>
<td></td>
</tr>
<tr>
<td><div align="right">Platform: </div></td>
<td>[% INCLUDE platformbox platforms=platforms defaultplatform=ua.platform(product) %]
</td>
<td></td>
</tr>
<tr>
<td><div align="right">Operating System: </div></td>
<td>
[% INCLUDE opsysbox opsyses=opsyses defaultopsys=defaultopsys %]
<br>
</td>
<td></td>
</tr>
<tr>
<td><div align="right">Branch: </div></td>
<td>[% INCLUDE branchbox branches=branches defaultbranch=ua.branch(product) %]</td>
<td></td>
</tr>
<tr>
<td><div align="right">Locale: </div></td>
<td>[% INCLUDE form_widgets/select_locale.tmpl name="locale" defaults.locale=ua.locale %]</td>
<td>&lArr; Note: this refers to the locale <em>of your browser</em>, not your physical location.</td>
</tr>
<tr>
<td><div align="right">Build ID:</div></td>
<td><input type="text" id="build_id" name="build_id" size="25" value="">
<script type="text/javascript">
var em = document.getElementById("build_id");
em.value = appBuildID;
</script>
</td>
<td>&lArr; <a name="showBuildIDHelpText" onclick="toggleHelp(buildIDHelpTitle,buildIDHelpText);">How do I determine the build ID?</a></td>
</tr>
<tr>
<td colspan="2">
<input class="category" type="submit" name="Submit" value="Submit">
</td>
</tr>
</table>
</form>
</div>
</div>
[% INCLUDE instructions/required_criteria.tmpl %]
[% INCLUDE runtests/test_run_detail.tmpl active_test_runs=test_run select_criteria=-1 display_title_link=0 %]
</div> <!--END content-->
</div> <!--END page-->
<script type="text/javascript">
beginCoverageLookup();
</script>
[% INCLUDE global/litmus_footer.tmpl %]
[% INCLUDE global/html_footer.tmpl %]

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

@ -0,0 +1,6 @@
<div class="[% IF recommended %]recommended_test_runs[% ELSE %]active_test_runs[% END %]">
<h1 class="firstHeading">[% title %]</h1>
[% INCLUDE reporting/test_run_summary.tmpl %]
</div>

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

@ -33,7 +33,8 @@
# @tests - an array of test objects to run
#%]
[% INCLUDE global/html_header.tmpl js_files=['js/prototype.lite.js','js/moo.fx.js','js/moo.fx.pack.js','js/RunTests.js'] %]
[% test_run=test_runs.0 %]
[% INCLUDE global/html_header.tmpl js_files=['js/prototype.lite.js','js/moo.fx.js','js/moo.fx.pack.js','js/RunTests.js','js/json.js','js/MochiKit/MochiKit.js','js/TestRunCoverage.js'] %]
[% INCLUDE global/litmus_header.tmpl %]
<div id="page">
@ -42,14 +43,21 @@
<div id="content">
<h1 class="firstHeading">[% title | html %]</h1>
<h1 class="firstHeading"><a title="Click to display details of your chosen Test Run." onclick="testConfigHeight.toggle('height');" name="test_run_details">Run Tests - Your Chosen Test Run&nbsp;&raquo;</a></h1>
[% INCLUDE runtests/testing_config.tmpl sysconfig=sysconfig %]
<div id="test_run_summary">
[% INCLUDE reporting/test_run_summary.tmpl active_test_runs=test_runs display_title_link=0 %]
</div>
<hr/>
<h1 class="firstHeading">Enter Test Results</h1>
<form action="process_test.cgi" method="post" name="form" id="form">
<input name="isTestResult" type="hidden" value="true" />
<input name="editingTestcases" id="editingTestcases" type="hidden" value="" />
<input name="testgroup" type="hidden" value="[% group.testgroup_id FILTER html %]" />
<input type="hidden" id="test_run_id" name="test_run_id" value="[% test_run.test_run_id %]"/>
<input id="isTestResult" name="isTestResult" type="hidden" value="true" />
<input id="editingTestcases" name="editingTestcases" id="editingTestcases" type="hidden" value="" />
<input id="testgroup" name="testgroup" type="hidden" value="[% group.testgroup_id FILTER html %]" />
<div class="section-full">
<div class="sec_head">
@ -90,10 +98,10 @@
<!-- Test [% i %] Start -->
[% IF show_admin %]
[% results=curtest.is_completed(sysconfig.platform,sysconfig.build_id,sysconfig.locale,defaultemail,show_admin) %]
[% results=curtest.isCompleted(sysconfig.opsys_id,sysconfig.build_id,sysconfig.locale,defaultemail,show_admin) %]
[% already_run_text = 'A trusted tester has already submitted a result for this testcase.' %]
[% ELSE %]
[% results=curtest.is_completed(sysconfig.platform,sysconfig.build_id,sysconfig.locale,defaultemail) %]
[% results=curtest.isCompleted(sysconfig.opsys_id,sysconfig.build_id,sysconfig.locale,defaultemail) %]
[% already_run_text = 'You have already submitted a result for this testcase.' %]
[% END %]
@ -146,9 +154,9 @@ var tmp_menub=new Array([% i=1 %][% FOREACH testcase_id=testcase_ids %]"mb[% i %
</form>
<script type="text/javascript">
Element.cleanWhitespace('testconfig');
showAll=0;
tc_init();
beginCoverageLookup();
</script>
</div> <!--END content-->

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

@ -32,24 +32,26 @@
[% title="View Testcase" %]
[% includeselects=1 %]
[% INCLUDE global/html_header.tmpl js_files=['js/FormValidation.js','js/MochiKit/MochiKit.js','js/json.js','js/Help.js','js/SelectBoxes.js','js/FormPersist.js','js/ViewTestcase.js'] %]
[% INCLUDE global/litmus_header.tmpl %]
<script type="text/javascript">
var products=[% products_js %];
var testgroups=[% testgroups_js %];
var subgroups=[% subgroups_js %];
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 formName='testcase_search_by_category';
var suffix='_id';
function init() {
selectsOnLoad();
[% IF searchType == "by_category" %]
productBox = document.getElementById('product_id');
testgroupBox = document.getElementById('testgroup_id');
FormInit(document.forms['testcase_search_by_category'], document.location.search);
changeProduct(productBox);
changeProduct();
FormInit(document.forms['testcase_search_by_category'], document.location.search);
changeTestgroup(testgroupBox);
changeBranch();
FormInit(document.forms['testcase_search_by_category'], document.location.search);
changeTestgroup();
[% END %]
[% IF searchType == "by_id" %]
FormInit(document.forms['testcase_search_by_id'], document.location.search);
@ -93,18 +95,25 @@ var relevanceHelpText = '<p>Relevance values are non-negative floating-point num
<table border="0">
<tr>
<td>Product:</td>
<td>Branch:</td>
</tr>
<tr>
<td>
[% INCLUDE form_widgets/select_product_id.tmpl name="product_id" placeholder=1 display_id=1 onchange="changeProduct();changeBranch();changeTestgroup;populateSubgroups();" %]
</td>
<td>
[% INCLUDE form_widgets/select_branch_id.tmpl name="branch_id" placeholder=1 display_id=1 onchange="changeBranch();changeTestgroup();populateSubgroups();" %]
</td>
<tr>
<td>Testgroup:</td>
<td>Subgroup:</td>
</tr>
<tr>
<td>
[% INCLUDE form_widgets/select_product_id.tmpl name="product_id" placeholder=1 onchange="changeProduct(this);" %]
</td>
<tr>
<td>
[% INCLUDE form_widgets/select_testgroup_id.tmpl name="testgroup_id" placeholder=1 onchange="changeTestgroup(this);" %]
[% INCLUDE form_widgets/select_testgroup_id.tmpl name="testgroup_id" placeholder=1 display_id=1 onchange="changeTestgroup();" %]
</td>
<td>
[% INCLUDE form_widgets/select_subgroup_id.tmpl name="subgroup_id" placeholder=1 %]
[% INCLUDE form_widgets/select_subgroup_id.tmpl name="subgroup_id" display_id=1 placeholder=1 %]
</td>
</tr>
</table>

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

@ -33,17 +33,13 @@
# @subgroups - a list of subgroups to which the current testcase belongs
#%]
[% PROCESS global/selects.none.tmpl %]
[% IF testcase.community_enabled OR show_admin %]
[% title="Testcase ID #$testcase.testcase_id - $testcase.summary" %]
[% ELSE %]
[% title="Testcase disabled" %]
[% END %]
[% includeselects=1 %]
[% INCLUDE global/html_header.tmpl js_files=['js/prototype.lite.js','js/moo.fx.js','js/moo.fx.pack.js','js/EditTests.js','js/FormValidation.js','js/SelectBoxes.js','js/ManageTestcases.js'] %]
[% INCLUDE global/html_header.tmpl js_files=['js/prototype.lite.js','js/moo.fx.js','js/moo.fx.pack.js','js/FormValidation.js','js/SelectBoxes.js','js/ManageTestcases.js'] %]
[% INCLUDE global/litmus_header.tmpl %]
<div id="page">

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

@ -4,7 +4,7 @@
<ul>
[% order_num=1 %]
[% FOREACH curtest=tests %]
[% results=curtest.is_completed(sysconfig.platform,sysconfig.build_id,sysconfig.locale,defaultemail) %]
[% results=curtest.isCompleted(sysconfig.opsys_id,sysconfig.build_id,sysconfig.locale,defaultemail) %]
<li class="tcs" id="li[% order_num %]"><a id="a[% order_num %]" onclick="window.location.href='#test_[% order_num %]'; allStretch.showThisHideOpen($('t[% order_num %]-content'), 100, 'height'); return false;">[% order_num %]. [% IF results %]<strike>[% END %][% curtest.summary | html %][% IF results %]</strike>[% END %]</a>
</li>
[% order_num=order_num+1 %]

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

@ -32,8 +32,6 @@
# $show_edit (optional) - display subgroup for editing
#%]
[% PROCESS global/selects.none.tmpl %]
[% IF show_config %]
<table cellspacing="0" cellpadding="0" class="tcm">
<tr>

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

@ -32,8 +32,6 @@
# $show_edit (optional) - display testcase for editing
#%]
[% PROCESS global/selects.none.tmpl %]
[% IF show_config %]
<table cellspacing="0" cellpadding="0" class="tcm">
<tr>

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

@ -0,0 +1,87 @@
[%# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1
#
# 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 Litmus.
#
# The Initial Developer of the Original Code is
# The Mozilla Corporation.
# Portions created by the Initial Developer are Copyright (C) 2006
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
# Chris Cooper <ccooper@deadsquid.com>
# Zach Lipton <zach@zachlipton.com>
#
# ***** END LICENSE BLOCK *****
#%]
[%# INTERFACE:
# $test_run - the test run object to show
# $show_config - display the config options (product, etc.)
# for a given test run
# $show_edit (optional) - display test run for editing
#%]
[% IF show_config %]
<table cellspacing="0" cellpadding="0" class="tcm">
<tr>
<td><b>Test Run ID #:</b></td>
<td id="test_run_id_display[% IF ! show_edit %]_[% test_run.test_run_id | html %][% END %]">[% test_run.test_run_id | html %]</td>
[% IF ! show_edit %]<td align="right" valign="top" colspan="5"><a href="manage_test_runs.cgi?test_run_id=[%test_run.test_run_id | html%]"> Edit Test Run</a></td>[% END %]
</tr>
<tr>
<td><b>Name:</b></td>
<td><div id="name_text[% IF ! show_edit %]_[% test_run.test_run_id | html%][% END %]">[% test_run.name | html %]</div></td>
</tr>
<tr>
<td><b>Description:</b></td>
<td><div id="desc_text[% IF ! show_edit %]_[% test_run.test_run_id | html%][% END %]">[% IF test_run.description %][% test_run.description | html %][% ELSE %]<em>No description provided.</em>[% END %]</div></td>
</tr>
<tr>
<td width="20%"><b>Product:</b></td>
<td>
<div id="product_text[% IF ! show_edit %]_[% test_run.test_run_id | html %][% END %]">[% test_run.product.name | html %]</div>
</td>
</tr>
<tr>
<td width="20%"><b>Branch:</b></td>
<td>
<div id="branch_text[% IF ! show_edit %]_[% test_run.test_run_id | html %][% END %]">[% test_run.branch.name | html %]</div>
</td>
</tr>
<tr>
<td width="20%"><b>Start Timestamp:</b></td>
<td>
<div id="start_timestamp_text[% IF ! show_edit %]_[% test_run.test_run_id | html %][% END %]">[% test_run.start_timestamp | html %]</div>
</td>
</tr>
<tr>
<td width="20%"><b>Finish Timestamp:</b></td>
<td>
<div id="finish_timestamp_text[% IF ! show_edit %]_[% test_run.test_run_id | html %][% END %]">[% test_run.finish_timestamp | html %]</div>
</td>
</tr>
[% IF show_admin %]
<tr>
<td><b>Enabled?</b></td>
<td><input id="enabled_display" name="enabled_display" type="checkbox" value="1" [% IF test_run.enabled %] checked[% END %] disabled></td>
</tr>
<tr>
<td><b>Recommended?</b></td>
<td><input id="recommended_display" name="recommended_display" type="checkbox" value="1" [% IF test_run.recommended %] checked[% END %] disabled></td>
</tr>
[% END %]
</table>
<br clear="all" />
[% END %]

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

@ -32,8 +32,6 @@
# $show_edit (optional) - display testgroup for editing
#%]
[% PROCESS global/selects.none.tmpl %]
[% IF show_config %]
<table cellspacing="0" cellpadding="0" class="tcm">
<tr>

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

@ -0,0 +1,133 @@
#!/usr/bin/perl -w
# -*- mode: cperl; c-basic-offset: 8; indent-tabs-mode: nil; -*-
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1
#
# 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 Litmus.
#
# The Initial Developer of the Original Code is
# the Mozilla Corporation.
# Portions created by the Initial Developer are Copyright (C) 2006
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
# Chris Cooper <ccooper@deadsquid.com>
# Zach Lipton <zach@zachlipton.com>
#
# ***** END LICENSE BLOCK *****
use strict;
use Time::HiRes qw( gettimeofday tv_interval );
our $t0 = [gettimeofday];
use Litmus;
use Litmus::Auth;
use Litmus::FormWidget;
use Litmus::Error;
use Litmus::SysConfig;
Litmus->init();
my $c = Litmus->cgi();
print $c->header();
my $test_run_id = $c->param("test_run_id");
if (!$test_run_id) {
invalidInputError("No Test Run selected!");
exit 1;
}
my $test_run = Litmus::DB::TestRun->getTestRunWithRefs($test_run_id);
my @sysconfigs;
foreach my $criterion (@{$test_run->{'criteria'}}) {
my $sysconfig = Litmus::SysConfig::new(
$test_run_id,
$criterion->{'build_id'},
$criterion->{'platform_id'} || undef,
$criterion->{'opsys_id'} || undef,
undef
);
push @sysconfigs, $sysconfig;
}
my $user = Litmus::Auth::getCookie();
my @testgroups;
if (Litmus::Auth::istrusted($user)) {
@testgroups = Litmus::DB::Testgroup->search_ByTestRun($test_run_id);
} else {
@testgroups = Litmus::DB::Testgroup->search_EnabledByTestRun($test_run_id);
}
# All possible subgroups per group:
my %subgroups;
my %testcases;
my %testcase_coverage;
foreach my $testgroup (@testgroups) {
my @component_subgroups;
if (Litmus::Auth::istrusted($user)) {
@component_subgroups = Litmus::DB::Subgroup->search_ByTestgroup($testgroup->testgroup_id());
} else {
@component_subgroups = Litmus::DB::Subgroup->search_EnabledByTestgroup($testgroup->testgroup_id());
}
$subgroups{$testgroup->testgroup_id()} = \@component_subgroups;
foreach my $subgroup (@component_subgroups) {
my @component_testcases;
if (Litmus::Auth::istrusted($user)) {
@component_testcases= Litmus::DB::Testcase->search_BySubgroup($subgroup->subgroup_id());
} else {
@component_testcases = Litmus::DB::Testcase->search_EnabledBySubgroup($subgroup->subgroup_id(),$testgroup->testgroup_id());
}
$testcases{$subgroup->subgroup_id()} = \@component_testcases;
foreach my $testcase (@component_testcases) {
foreach my $sysconfig (@sysconfigs) {
my $coverage = $testcase->coverage(
$sysconfig->{'build_id'} || 0,
$sysconfig->{'platform_id'} || 0,
$sysconfig->{'opsys_id'} || 0,
$sysconfig->{'locale'} || 0
);
$testcase_coverage{$testcase->{'testcase_id'}}{$sysconfig->{'id'}} = $coverage || 0;
}
}
}
}
my $title = 'Test Run Report';
my $vars = {
title => $title,
test_runs => [$test_run],
testcase_coverage => \%testcase_coverage,
testgroups => \@testgroups,
subgroups => \%subgroups,
testcases => \%testcases,
sysconfigs => \@sysconfigs,
};
my $cookie = Litmus::Auth::getCookie();
$vars->{"defaultemail"} = $cookie;
$vars->{"show_admin"} = Litmus::Auth::istrusted($cookie);
Litmus->template()->process("reporting/test_run_report.tmpl", $vars) ||
internalError(Litmus->template()->error());
if ($Litmus::Config::DEBUG) {
my $elapsed = tv_interval ( $t0 );
printf "<div id='pageload'>Page took %f seconds to load.</div>", $elapsed;
}
exit 0;