Clean out tabs, barewords, pod etc so files pass tests.
git-svn-id: svn://10.0.0.236/trunk@247566 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -236,8 +236,8 @@ sub store {
|
||||
}
|
||||
|
||||
sub to_json {
|
||||
my $self = shift;
|
||||
my $cgi = shift;
|
||||
my $self = shift;
|
||||
my $cgi = shift;
|
||||
my $obj;
|
||||
my $json = new JSON;
|
||||
|
||||
|
||||
@@ -24,8 +24,6 @@ use strict;
|
||||
|
||||
use Bugzilla::Util;
|
||||
use Bugzilla::Error;
|
||||
use Bugzilla::Testopia::TestPlan;
|
||||
use Bugzilla::Testopia::TestCase;
|
||||
use JSON;
|
||||
|
||||
use base qw(Exporter Bugzilla::Object);
|
||||
|
||||
@@ -24,8 +24,6 @@ use strict;
|
||||
|
||||
use Bugzilla::Util;
|
||||
use Bugzilla::Error;
|
||||
use Bugzilla::Testopia::TestPlan;
|
||||
use Bugzilla::Testopia::TestCase;
|
||||
use Bugzilla::Testopia::Product;
|
||||
|
||||
use JSON;
|
||||
|
||||
@@ -72,27 +72,27 @@ sub products_to_json {
|
||||
$disable_move = ',"addChild","move"' if $disable_move;
|
||||
my $products = $self->user_visible_products;
|
||||
|
||||
|
||||
my @values;
|
||||
|
||||
my @values;
|
||||
|
||||
foreach my $product (@$products)
|
||||
{
|
||||
my $leaf;
|
||||
|
||||
if(scalar @{$product->environment_categories}> 0)
|
||||
{
|
||||
$leaf = "false";
|
||||
}
|
||||
else
|
||||
{
|
||||
$leaf = "true";
|
||||
}
|
||||
|
||||
push @values, {text=> $product->{'name'}, id=> $product->{'id'} . ' product', type=> 'product', leaf=>$leaf, draggable => 'false', cls => 'product'};
|
||||
{
|
||||
my $leaf;
|
||||
|
||||
if(scalar @{$product->environment_categories}> 0)
|
||||
{
|
||||
$leaf = "false";
|
||||
}
|
||||
else
|
||||
{
|
||||
$leaf = "true";
|
||||
}
|
||||
|
||||
push @values, {text=> $product->{'name'}, id=> $product->{'id'} . ' product', type=> 'product', leaf=>$leaf, draggable => 'false', cls => 'product'};
|
||||
}
|
||||
|
||||
|
||||
return $json->objToJson(\@values);
|
||||
|
||||
return $json->objToJson(\@values);
|
||||
|
||||
# my $json = "[";
|
||||
# foreach my $obj (@{$products}){
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
# Contributor(s): Greg Hendricks <ghendricks@novell.com>
|
||||
# Michael Hight <mjhight@gmail.com>
|
||||
# Garrett Braden <gbraden@novell.c
|
||||
# Andrew Nelson <anelson@novell.com>
|
||||
# Andrew Nelson <anelson@novell.com>
|
||||
|
||||
=head1 NAME
|
||||
|
||||
@@ -280,23 +280,23 @@ sub product_categories_to_json {
|
||||
|
||||
my $categories = $self->get_element_categories_by_product($product_id);
|
||||
|
||||
my @values;
|
||||
my @values;
|
||||
|
||||
foreach my $cat (@$categories)
|
||||
{
|
||||
my $leaf;
|
||||
if($cat->check_for_elements)
|
||||
{
|
||||
$leaf = 'false';
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
$leaf = 'true';
|
||||
}
|
||||
|
||||
push @values, {text=> $cat->{'name'}, id=> $cat->id . ' category', type=> 'category', leaf => $leaf, cls=> 'category'};
|
||||
}
|
||||
foreach my $cat (@$categories)
|
||||
{
|
||||
my $leaf;
|
||||
if($cat->check_for_elements)
|
||||
{
|
||||
$leaf = 'false';
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
$leaf = 'true';
|
||||
}
|
||||
|
||||
push @values, {text=> $cat->{'name'}, id=> $cat->id . ' category', type=> 'category', leaf => $leaf, cls=> 'category'};
|
||||
}
|
||||
|
||||
return $json->objToJson(\@values);
|
||||
|
||||
@@ -371,27 +371,27 @@ sub elements_to_json {
|
||||
my $elements = $self->get_parent_elements;
|
||||
my $json = '[';
|
||||
|
||||
my @values;
|
||||
my @values;
|
||||
|
||||
foreach my $element (@$elements)
|
||||
{
|
||||
my $leaf;
|
||||
if($element->check_for_children || $element->check_for_properties)
|
||||
{
|
||||
$leaf = 'false';
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
$leaf = 'true';
|
||||
}
|
||||
|
||||
push @values, {text=> $element->{'name'}, id=> ($element->{'element_id'}) . ' element', type=> 'element', leaf => $leaf, cls=> 'element'};
|
||||
}
|
||||
|
||||
$json = new JSON();
|
||||
return $json->objToJson(\@values);
|
||||
|
||||
foreach my $element (@$elements)
|
||||
{
|
||||
my $leaf;
|
||||
if($element->check_for_children || $element->check_for_properties)
|
||||
{
|
||||
$leaf = 'false';
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
$leaf = 'true';
|
||||
}
|
||||
|
||||
push @values, {text=> $element->{'name'}, id=> ($element->{'element_id'}) . ' element', type=> 'element', leaf => $leaf, cls=> 'element'};
|
||||
}
|
||||
|
||||
$json = new JSON();
|
||||
return $json->objToJson(\@values);
|
||||
|
||||
# foreach my $element (@$elements)
|
||||
# {
|
||||
# $json .= '{title:"'. $element->{'name'} .'",';
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
# Contributor(s): Greg Hendricks <ghendricks@novell.com>
|
||||
# Michael Hight <mjhight@gmail.com>
|
||||
# Garrett Braden <gbraden@novell.com>
|
||||
# Andrew Nelson <anelson@novell.com>
|
||||
# Andrew Nelson <anelson@novell.com>
|
||||
|
||||
=head1 NAME
|
||||
|
||||
@@ -136,7 +136,7 @@ Checks to see if the element has en environment mapping
|
||||
=cut
|
||||
|
||||
sub isMapped{
|
||||
my $dbh = Bugzilla->dbh;
|
||||
my $dbh = Bugzilla->dbh;
|
||||
my $self = shift;
|
||||
|
||||
my $id = $self->id;
|
||||
@@ -147,7 +147,7 @@ sub isMapped{
|
||||
foreach my $val (@$ref){
|
||||
if($id == $val)
|
||||
{
|
||||
return 1;
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -288,26 +288,25 @@ my @values;
|
||||
|
||||
foreach my $element (@$elements)
|
||||
{
|
||||
my $leaf;
|
||||
if($element->check_for_children || $element->check_for_properties)
|
||||
{
|
||||
$leaf = 'false';
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
$leaf = 'true';
|
||||
}
|
||||
|
||||
push @values, {text=> $element->{'name'}, id=> $element->{'element_id'} . ' element', type=> 'element', leaf => $leaf, cls =>'element'};
|
||||
my $leaf;
|
||||
if($element->check_for_children || $element->check_for_properties)
|
||||
{
|
||||
$leaf = 'false';
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
$leaf = 'true';
|
||||
}
|
||||
|
||||
push @values, {text=> $element->{'name'}, id=> $element->{'element_id'} . ' element', type=> 'element', leaf => $leaf, cls =>'element'};
|
||||
}
|
||||
|
||||
foreach my $property (@$properties)
|
||||
{
|
||||
push @values, {text=> $property->{'name'}, id=> $property->id . ' property', type=> 'property', leaf => 'false', cls =>'property'};
|
||||
{
|
||||
push @values, {text=> $property->{'name'}, id=> $property->id . ' property', type=> 'property', leaf => 'false', cls =>'property'};
|
||||
}
|
||||
|
||||
my $json = new JSON;
|
||||
return $json->objToJson(\@values);
|
||||
|
||||
|
||||
@@ -367,19 +366,19 @@ sub new_element_count{
|
||||
|
||||
sub this_to_json
|
||||
{
|
||||
my $self = shift;
|
||||
|
||||
my $element = {
|
||||
text=> $self->{'name'},
|
||||
id=> $self->{'element_id'} . ' element',
|
||||
type=> 'element',
|
||||
leaf => 'true',
|
||||
cls =>'element',
|
||||
allowDrop => 'false',
|
||||
disabled => 'true'
|
||||
};
|
||||
my $json = new JSON();
|
||||
print $json->objToJson($element);
|
||||
my $self = shift;
|
||||
|
||||
my $element = {
|
||||
text=> $self->{'name'},
|
||||
id=> $self->{'element_id'} . ' element',
|
||||
type=> 'element',
|
||||
leaf => 'true',
|
||||
cls =>'element',
|
||||
allowDrop => 'false',
|
||||
disabled => 'true'
|
||||
};
|
||||
my $json = new JSON();
|
||||
print $json->objToJson($element);
|
||||
|
||||
}
|
||||
=head2 check_for_properties
|
||||
@@ -572,9 +571,9 @@ sub get_parent {
|
||||
}
|
||||
|
||||
sub is_parent_a_category{
|
||||
my $self = shift;
|
||||
my $self = shift;
|
||||
if ($self->{'parent_id'}){
|
||||
return 0;
|
||||
return 0;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -290,24 +290,22 @@ sub valid_exp_to_json {
|
||||
|
||||
my @validexpressions = split(/\|/, @$validexp[0]);
|
||||
|
||||
my $json = '[';
|
||||
|
||||
|
||||
my @validExpressionsArray;
|
||||
foreach (@validexpressions)
|
||||
{
|
||||
my $class;
|
||||
if ($env && $env->get_value_selected($env->id, $self->element_id, $self->id) eq $_)
|
||||
{
|
||||
{
|
||||
my $class;
|
||||
if ($env && $env->get_value_selected($env->id, $self->element_id, $self->id) eq $_)
|
||||
{
|
||||
$class = "validexpYellow";
|
||||
}
|
||||
else
|
||||
{
|
||||
$class = "validexp";
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
$class = "validexp";
|
||||
}
|
||||
|
||||
push @validExpressionsArray, {text=> $_, id=> $self->id . ' ' . $_ . ' validexp', value => $_, type=> 'validexp', leaf => 'true', cls=> $class};
|
||||
}
|
||||
}
|
||||
|
||||
my $json = new JSON;
|
||||
return $json->objToJson(\@validExpressionsArray);
|
||||
|
||||
@@ -281,8 +281,7 @@ sub canedit {
|
||||
}
|
||||
|
||||
sub to_json {
|
||||
my $self = shift;
|
||||
my $cgi = shift;
|
||||
my $self = shift;
|
||||
my $obj;
|
||||
my $json = new JSON;
|
||||
|
||||
|
||||
@@ -150,7 +150,7 @@ sub init {
|
||||
my $type;
|
||||
|
||||
my $obj = trim($cgi->param('current_tab')) || ThrowUserError('testopia-missing-parameter', {'param' => 'current_tab'});
|
||||
ThrowUserError('unknown-tab') if $obj !~ '^(case|plan|run|case_run|environment)$';
|
||||
ThrowUserError('testopia-unknown-tab', {tab => $obj}) if $obj !~ '^(case|plan|run|case_run|environment)$';
|
||||
trick_taint($obj);
|
||||
|
||||
# If what we intend to do is generate a report, we need some tables
|
||||
|
||||
@@ -85,7 +85,7 @@ use constant UPDATE_COLUMNS => qw(case_status_id category_id priority_id
|
||||
isautomated sortkey script arguments summary requirement
|
||||
alias estimated_time dependson blocks runs tags components);
|
||||
|
||||
use constant VALIDATORS => {
|
||||
sub VALIDATORS {
|
||||
case_status_id => \&_check_status,
|
||||
category_id => \&_check_category,
|
||||
priority_id => \&_check_priority,
|
||||
@@ -883,7 +883,7 @@ sub add_to_run {
|
||||
my $runs = $self->_check_runs($runids);
|
||||
|
||||
foreach my $run (@$runs){
|
||||
$run->add_case_run($self->id);
|
||||
$run->add_case_run($self->id);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -894,24 +894,24 @@ Adds a list of test cases to the current test cases being blocked by the testcas
|
||||
=cut
|
||||
|
||||
sub add_blocks {
|
||||
my $self = shift;
|
||||
my $case_ids = shift;
|
||||
|
||||
my $cases = $self->_check_cases($case_ids);
|
||||
my @blocks;
|
||||
|
||||
my $self = shift;
|
||||
my $case_ids = shift;
|
||||
|
||||
my $cases = $self->_check_cases($case_ids);
|
||||
my @blocks;
|
||||
|
||||
my $dbh = Bugzilla->dbh();
|
||||
|
||||
# Get a list of the cases this test case currently blocks
|
||||
my $current_blocks = $dbh->selectcol_arrayref("SELECT blocked
|
||||
FROM test_case_dependencies
|
||||
WHERE dependson = ?",
|
||||
undef,
|
||||
$self->id());
|
||||
|
||||
# Get a list of the cases this test case currently blocks
|
||||
my $current_blocks = $dbh->selectcol_arrayref("SELECT blocked
|
||||
FROM test_case_dependencies
|
||||
WHERE dependson = ?",
|
||||
undef,
|
||||
$self->id());
|
||||
|
||||
# update the list of items
|
||||
foreach (@$cases) {
|
||||
push @blocks, $_->id();
|
||||
push @blocks, $_->id();
|
||||
}
|
||||
|
||||
push @blocks, @$current_blocks;
|
||||
@@ -929,22 +929,22 @@ Removes a list of test cases from being blocked by the testcase
|
||||
=cut
|
||||
|
||||
sub remove_blocks {
|
||||
my $self = shift;
|
||||
my $case_ids = shift;
|
||||
|
||||
return 0 if ($case_ids eq '' or !defined $case_ids);
|
||||
|
||||
my $dbh = Bugzilla->dbh();
|
||||
|
||||
my @cases;
|
||||
|
||||
foreach my $case (split /,/, $case_ids)
|
||||
{
|
||||
detaint_natural($case);
|
||||
push @cases, $case;
|
||||
}
|
||||
|
||||
my $query =<<QUERY;
|
||||
my $self = shift;
|
||||
my $case_ids = shift;
|
||||
|
||||
return 0 if ($case_ids eq '' or !defined $case_ids);
|
||||
|
||||
my $dbh = Bugzilla->dbh();
|
||||
|
||||
my @cases;
|
||||
|
||||
foreach my $case (split /,/, $case_ids)
|
||||
{
|
||||
detaint_natural($case);
|
||||
push @cases, $case;
|
||||
}
|
||||
|
||||
my $query =<<QUERY;
|
||||
DELETE
|
||||
FROM test_case_dependencies
|
||||
WHERE dependson = ?
|
||||
@@ -964,24 +964,24 @@ Adds a list of test cases to the current test cases depended on by the testcase
|
||||
=cut
|
||||
|
||||
sub add_dependson {
|
||||
my $self = shift;
|
||||
my $case_ids = shift;
|
||||
|
||||
my $cases = $self->_check_cases($case_ids);
|
||||
my @dependson;
|
||||
|
||||
my $self = shift;
|
||||
my $case_ids = shift;
|
||||
|
||||
my $cases = $self->_check_cases($case_ids);
|
||||
my @dependson;
|
||||
|
||||
my $dbh = Bugzilla->dbh();
|
||||
|
||||
# Get a list of the cases this test case currently blocks
|
||||
my $current_dependson = $dbh->selectcol_arrayref("SELECT dependson
|
||||
FROM test_case_dependencies
|
||||
WHERE blocked = ?",
|
||||
undef,
|
||||
$self->id());
|
||||
|
||||
# Get a list of the cases this test case currently blocks
|
||||
my $current_dependson = $dbh->selectcol_arrayref("SELECT dependson
|
||||
FROM test_case_dependencies
|
||||
WHERE blocked = ?",
|
||||
undef,
|
||||
$self->id());
|
||||
|
||||
# update the list of items
|
||||
foreach (@$cases) {
|
||||
push @dependson, $_->id();
|
||||
push @dependson, $_->id();
|
||||
}
|
||||
|
||||
push @dependson, @$current_dependson;
|
||||
@@ -999,22 +999,22 @@ Adds a list of test cases to the current test cases depended on by the testcase
|
||||
=cut
|
||||
|
||||
sub remove_dependson {
|
||||
my $self = shift;
|
||||
my $case_ids = shift;
|
||||
|
||||
return 0 if ($case_ids eq '' or !defined $case_ids);
|
||||
|
||||
my $dbh = Bugzilla->dbh();
|
||||
|
||||
my @cases;
|
||||
|
||||
foreach my $case (split /,/, $case_ids)
|
||||
{
|
||||
detaint_natural($case);
|
||||
push @cases, $case;
|
||||
}
|
||||
|
||||
my $query =<<QUERY;
|
||||
my $self = shift;
|
||||
my $case_ids = shift;
|
||||
|
||||
return 0 if ($case_ids eq '' or !defined $case_ids);
|
||||
|
||||
my $dbh = Bugzilla->dbh();
|
||||
|
||||
my @cases;
|
||||
|
||||
foreach my $case (split /,/, $case_ids)
|
||||
{
|
||||
detaint_natural($case);
|
||||
push @cases, $case;
|
||||
}
|
||||
|
||||
my $query =<<QUERY;
|
||||
DELETE
|
||||
FROM test_case_dependencies
|
||||
WHERE blocked = ?
|
||||
|
||||
@@ -83,7 +83,7 @@ use constant DB_COLUMNS => qw(
|
||||
use constant REQUIRED_CREATE_FIELDS => qw(case_id run_id build_id environment_id case_run_status_id);
|
||||
use constant UPDATE_COLUMNS => qw(case_run_status_id case_text_version notes sortkey);
|
||||
|
||||
use constant VALIDATORS => {
|
||||
sub VALIDATORS {
|
||||
case_id => \&_check_case_id,
|
||||
build_id => \&_check_build_id,
|
||||
run_id => \&_check_run_id,
|
||||
|
||||
@@ -31,7 +31,6 @@ use Bugzilla::Version;
|
||||
use Bugzilla::Testopia::Constants;
|
||||
use Bugzilla::Testopia::Util;
|
||||
use Bugzilla::Testopia::TestRun;
|
||||
use Bugzilla::Testopia::TestCase;
|
||||
use Bugzilla::Testopia::Category;
|
||||
use Bugzilla::Testopia::Build;
|
||||
use Bugzilla::Testopia::TestTag;
|
||||
@@ -77,7 +76,7 @@ use constant DB_COLUMNS => qw(
|
||||
use constant REQUIRED_CREATE_FIELDS => qw(product_id author_id type_id default_product_version name);
|
||||
use constant UPDATE_COLUMNS => qw(product_id type_id default_product_version name isactive);
|
||||
|
||||
use constant VALIDATORS => {
|
||||
sub VALIDATORS {
|
||||
product_id => \&_check_product,
|
||||
author_id => \&_check_author,
|
||||
type_id => \&_check_type,
|
||||
|
||||
@@ -27,10 +27,10 @@ use strict;
|
||||
use Bugzilla::Util;
|
||||
use Bugzilla::User;
|
||||
use Bugzilla::Constants;
|
||||
use Bugzilla::Testopia::Constants;
|
||||
use Bugzilla::Config;
|
||||
use Bugzilla::Testopia::Environment;
|
||||
use Bugzilla::Bug;
|
||||
use Bugzilla::Config;
|
||||
use Bugzilla::Testopia::Constants;
|
||||
use Bugzilla::Testopia::Environment;
|
||||
|
||||
use JSON;
|
||||
use base qw(Exporter Bugzilla::Object);
|
||||
@@ -85,7 +85,7 @@ use constant UPDATE_COLUMNS => qw(environment_id build_id product_versio
|
||||
summary manager_id plan_text_version notes
|
||||
stop_date);
|
||||
|
||||
use constant VALIDATORS => {
|
||||
sub VALIDATORS {
|
||||
plan_id => \&_check_plan,
|
||||
environment_id => \&_check_env,
|
||||
build_id => \&_check_build,
|
||||
|
||||
@@ -46,7 +46,7 @@ use Bugzilla::Config;
|
||||
use Bugzilla::Error;
|
||||
use Bugzilla::Constants;
|
||||
use Bugzilla::Util;
|
||||
use Bugzilla::Testopia::TestPlan;
|
||||
#use Bugzilla::Testopia::TestPlan;
|
||||
|
||||
### Methods ###
|
||||
|
||||
|
||||
@@ -27,6 +27,7 @@ use base qw(Bugzilla::WebService);
|
||||
|
||||
use Bugzilla::Constants;
|
||||
use Bugzilla::Testopia::Build;
|
||||
use Bugzilla::Testopia::Product;
|
||||
|
||||
sub get {
|
||||
my $self = shift;
|
||||
@@ -109,7 +110,7 @@ sub update{
|
||||
next;
|
||||
}
|
||||
unless ($build->product->canedit){
|
||||
ThrowUserError('testopia-read-only', {'object' => $product}) if scalar @ids == 1;
|
||||
ThrowUserError('testopia-read-only', {'object' => $build->product}) if scalar @ids == 1;
|
||||
push @builds, {FAILED => 1, message => "You do not have rights to view this product"};
|
||||
next;
|
||||
}
|
||||
@@ -187,21 +188,21 @@ Provides methods for automated scripts to manipulate Testopia Builds
|
||||
=over
|
||||
|
||||
=item C<check_build($name, $product)>
|
||||
|
||||
|
||||
Description: Looks up and returns a build by name.
|
||||
|
||||
|
||||
Params: $name - String: name of the build.
|
||||
$product - Integer/String/Object
|
||||
Integer: product_id of the product in the Database
|
||||
String: Product name
|
||||
Object: Blessed Bugzilla::Product object
|
||||
|
||||
|
||||
Returns: Hash: Matching Build object hash or error if not found.
|
||||
|
||||
|
||||
=item C<create($values)>
|
||||
|
||||
|
||||
Description: Creates a new build object and stores it in the database
|
||||
|
||||
|
||||
Params: $values - Hash: A reference to a hash with keys and values
|
||||
matching the fields of the build to be created.
|
||||
+-------------+----------------+-----------+------------------------------------+
|
||||
@@ -213,31 +214,31 @@ Provides methods for automated scripts to manipulate Testopia Builds
|
||||
| description | String | Optional | |
|
||||
| isactive | Boolean | Optional | Defaults to True (1) |
|
||||
+-------------+----------------+-----------+------------------------------------+
|
||||
|
||||
|
||||
Returns: The newly created object hash.
|
||||
|
||||
|
||||
=item C<get($id)>
|
||||
|
||||
Description: Used to load an existing build from the database.
|
||||
|
||||
|
||||
Params: $id - An integer representing the ID in the database
|
||||
|
||||
|
||||
Returns: A blessed Bugzilla::Testopia::Build object hash
|
||||
|
||||
|
||||
=item C<lookup_id_by_name> B<DEPRICATED - CONSIDERED HARMFUL> Use Build::check_build instead
|
||||
|
||||
|
||||
=item C<lookup_name_by_id> B<DEPRICATED> Use Build::get instead
|
||||
|
||||
|
||||
=item C<update($ids, $values)>
|
||||
|
||||
|
||||
Description: Updates the fields of the selected build or builds.
|
||||
|
||||
|
||||
Params: $ids - Integer/String/Array
|
||||
Integer: A single build ID.
|
||||
String: A comma separates string of Build IDs for batch
|
||||
processing.
|
||||
Array: An array of build IDs for batch mode processing
|
||||
|
||||
|
||||
$values - Hash of keys matching Build fields and the new values
|
||||
to set each field to.
|
||||
+-------------+----------------+
|
||||
@@ -248,23 +249,19 @@ Provides methods for automated scripts to manipulate Testopia Builds
|
||||
| description | String |
|
||||
| isactive | Boolean |
|
||||
+-------------+----------------+
|
||||
|
||||
|
||||
Returns: Hash/Array: In the case of a single build it is returned. If a
|
||||
list was passed, it returns an array of build hashes. If the
|
||||
update on any particular build failed, the hash will contain a
|
||||
FAILED key and the message as to why it failed.
|
||||
|
||||
|
||||
=back
|
||||
|
||||
=head1 SEE ALSO
|
||||
|
||||
=over
|
||||
|
||||
L<Bugzilla::Testopia::Build>
|
||||
L<Bugzilla::Webservice>
|
||||
|
||||
=back
|
||||
|
||||
=head1 AUTHOR
|
||||
|
||||
Greg Hendricks <ghendricks@novell.com>
|
||||
@@ -169,21 +169,21 @@ Provides methods for automated scripts to manipulate Testopia Environments
|
||||
=over
|
||||
|
||||
=item C<check_environment($name, $product)>
|
||||
|
||||
|
||||
Description: Looks up and returns an environment by name.
|
||||
|
||||
|
||||
Params: $name - String: name of the environment.
|
||||
$product - Integer/String/Object
|
||||
Integer: product_id of the product in the Database
|
||||
String: Product name
|
||||
Object: Blessed Bugzilla::Product object
|
||||
|
||||
|
||||
Returns: Hash: Matching Environment object hash or error if not found.
|
||||
|
||||
|
||||
=item C<create($values)>
|
||||
|
||||
|
||||
Description: Creates a new environment object and stores it in the database
|
||||
|
||||
|
||||
Params: $values - Hash: A reference to a hash with keys and values
|
||||
matching the fields of the environment to be created.
|
||||
+-------------+----------------+-----------+------------------------------------+
|
||||
@@ -194,37 +194,36 @@ Provides methods for automated scripts to manipulate Testopia Environments
|
||||
| isactive | Boolean | Optional | Defaults to True (1) |
|
||||
+-------------+----------------+-----------+------------------------------------+
|
||||
|
||||
|
||||
Returns: The newly created object hash.
|
||||
|
||||
|
||||
=item C<get($id)>
|
||||
|
||||
Description: Used to load an existing Environment from the database.
|
||||
|
||||
|
||||
Params: $id - An integer representing the ID in the database
|
||||
|
||||
|
||||
Returns: A blessed Bugzilla::Testopia::Environment object hash
|
||||
|
||||
|
||||
=item C<get_caseruns($id)>
|
||||
|
||||
|
||||
Description: Returns the list of case-runs that this Environment is used in.
|
||||
|
||||
|
||||
Params: $id - Integer: Environment ID.
|
||||
|
||||
|
||||
Returns: Array: List of case-run object hashes.
|
||||
|
||||
|
||||
=item C<get_runs($id)>
|
||||
|
||||
|
||||
Description: Returns the list of runs that this Environment is used in.
|
||||
|
||||
|
||||
Params: $id - Integer: Environment ID.
|
||||
|
||||
|
||||
Returns: Array: List of run object hashes.
|
||||
|
||||
|
||||
=item C<list($query)>
|
||||
|
||||
|
||||
Description: Performs a search and returns the resulting list of Environments
|
||||
|
||||
|
||||
Params: $query - Hash: keys must match valid search fields.
|
||||
|
||||
+--------------------------+
|
||||
@@ -237,15 +236,15 @@ Provides methods for automated scripts to manipulate Testopia Environments
|
||||
| name |
|
||||
| env_value_selected_type |
|
||||
+--------------------------+
|
||||
|
||||
|
||||
Returns: Array: Matching Environments are retuned in a list of hashes.
|
||||
|
||||
|
||||
=item C<update($ids, $values)>
|
||||
|
||||
|
||||
Description: Updates the fields of the selected environment or environments.
|
||||
|
||||
|
||||
Params: $ids - Integer A single environment ID.
|
||||
|
||||
|
||||
$values - Hash of keys matching Environment fields and the new values
|
||||
to set each field to.
|
||||
+-------------+----------------+
|
||||
@@ -256,18 +255,14 @@ Provides methods for automated scripts to manipulate Testopia Environments
|
||||
+-------------+----------------+
|
||||
|
||||
Returns: Hash: The updated environment object hash.
|
||||
|
||||
|
||||
=back
|
||||
|
||||
=head1 SEE ALSO
|
||||
|
||||
=over
|
||||
|
||||
L<Bugzilla::Testopia::Environment>
|
||||
L<Bugzilla::Webservice>
|
||||
|
||||
=back
|
||||
|
||||
=head1 AUTHOR
|
||||
|
||||
Greg Hendricks <ghendricks@novell.com>
|
||||
@@ -43,7 +43,7 @@ sub _validate {
|
||||
$product = Bugzilla::Testopia::Product->new($product->id);
|
||||
}
|
||||
|
||||
ThrowUserError('invalid-test-id-non-existent', {type => 'Product', id => $id}) unless $product;
|
||||
ThrowUserError('invalid-test-id-non-existent', {type => 'Product', id => $product}) unless $product;
|
||||
ThrowUserError('testopia-permission-denied', {'object' => $product}) if $product && !$product->canedit;
|
||||
|
||||
return $product;
|
||||
@@ -195,150 +195,145 @@ Provides methods for automated scripts to expose Testopia Product data.
|
||||
=item C<get($id)>
|
||||
|
||||
Description: Used to load an existing product from the database.
|
||||
|
||||
|
||||
Params: $id - An integer representing the ID in the database
|
||||
|
||||
|
||||
Returns: A blessed Bugzilla::Testopia::Product object hash
|
||||
|
||||
|
||||
=item C<check_product($name, $product)>
|
||||
|
||||
|
||||
Description: Looks up and returns a validated product.
|
||||
|
||||
|
||||
Params: $name - String: name of the product.
|
||||
$product - Integer/String/Object
|
||||
Integer: product_id of the product in the Database
|
||||
String: Product name
|
||||
Object: Blessed Bugzilla::Product object
|
||||
|
||||
|
||||
Returns: Hash: Matching Product object hash or error if not found.
|
||||
|
||||
|
||||
=item C<get_builds($product, $active)>
|
||||
|
||||
|
||||
Description: Get the list of builds associated with this product.
|
||||
|
||||
|
||||
Params: $product - Integer/String/Object
|
||||
Integer: product_id of the product in the Database
|
||||
String: Product name
|
||||
Object: Blessed Bugzilla::Product object
|
||||
$active - Boolean: True to only include builds where isactive is true.
|
||||
|
||||
|
||||
Returns: Array: Returns an array of Build objects.
|
||||
|
||||
|
||||
=item C<get_cases($product)>
|
||||
|
||||
|
||||
Description: Get the list of cases associated with this product.
|
||||
|
||||
|
||||
Params: $product - Integer/String/Object
|
||||
Integer: product_id of the product in the Database
|
||||
String: Product name
|
||||
Object: Blessed Bugzilla::Product object
|
||||
|
||||
|
||||
Returns: Array: Returns an array of TestCase objects.
|
||||
|
||||
|
||||
=item C<get_categories($product)>
|
||||
|
||||
|
||||
Description: Get the list of categories associated with this product.
|
||||
|
||||
|
||||
Params: $product - Integer/String/Object
|
||||
Integer: product_id of the product in the Database
|
||||
String: Product name
|
||||
Object: Blessed Bugzilla::Product object
|
||||
|
||||
|
||||
Returns: Array: Returns an array of Case Category objects.
|
||||
|
||||
|
||||
=item C<get_components($product)>
|
||||
|
||||
|
||||
Description: Get the list of components associated with this product.
|
||||
|
||||
|
||||
Params: $product - Integer/String/Object
|
||||
Integer: product_id of the product in the Database
|
||||
String: Product name
|
||||
Object: Blessed Bugzilla::Product object
|
||||
|
||||
|
||||
Returns: Array: Returns an array of Component objects.
|
||||
|
||||
|
||||
=item C<get_environments($product)>
|
||||
|
||||
|
||||
Description: Get the list of environments associated with this product.
|
||||
|
||||
|
||||
Params: $product - Integer/String/Object
|
||||
Integer: product_id of the product in the Database
|
||||
String: Product name
|
||||
Object: Blessed Bugzilla::Product object
|
||||
|
||||
|
||||
Returns: Array: Returns an array of Environment objects.
|
||||
|
||||
|
||||
=item C<get_milestones($product)>
|
||||
|
||||
|
||||
Description: Get the list of milestones associated with this product.
|
||||
|
||||
|
||||
Params: $product - Integer/String/Object
|
||||
Integer: product_id of the product in the Database
|
||||
String: Product name
|
||||
Object: Blessed Bugzilla::Product object
|
||||
|
||||
|
||||
Returns: Array: Returns an array of Milestone objects.
|
||||
|
||||
|
||||
=item C<get_plans($product)>
|
||||
|
||||
|
||||
Description: Get the list of plans associated with this product.
|
||||
|
||||
|
||||
Params: $product - Integer/String/Object
|
||||
Integer: product_id of the product in the Database
|
||||
String: Product name
|
||||
Object: Blessed Bugzilla::Product object
|
||||
|
||||
|
||||
Returns: Array: Returns an array of Test Plan objects.
|
||||
|
||||
|
||||
=item C<get_runs($product)>
|
||||
|
||||
|
||||
Description: Get the list of runs associated with this product.
|
||||
|
||||
|
||||
Params: $product - Integer/String/Object
|
||||
Integer: product_id of the product in the Database
|
||||
String: Product name
|
||||
Object: Blessed Bugzilla::Product object
|
||||
|
||||
|
||||
Returns: Array: Returns an array of Test Run objects.
|
||||
|
||||
|
||||
=item C<get_tags($product)>
|
||||
|
||||
|
||||
Description: Get the list of tags associated with this product.
|
||||
|
||||
|
||||
Params: $product - Integer/String/Object
|
||||
Integer: product_id of the product in the Database
|
||||
String: Product name
|
||||
Object: Blessed Bugzilla::Product object
|
||||
|
||||
|
||||
Returns: Array: Returns an array of Tags objects.
|
||||
|
||||
|
||||
=item C<get_versions($product)>
|
||||
|
||||
|
||||
Description: Get the list of versions associated with this product.
|
||||
|
||||
|
||||
Params: $product - Integer/String/Object
|
||||
Integer: product_id of the product in the Database
|
||||
String: Product name
|
||||
Object: Blessed Bugzilla::Product object
|
||||
|
||||
|
||||
Returns: Array: Returns an array of Version objects.
|
||||
|
||||
|
||||
=item C<lookup_name_by_id> B<DEPRICATED> Use Product::get instead
|
||||
|
||||
|
||||
=item C<lookup_id_by_name> B<DEPRICATED - CONSIDERED HARMFUL> Use Product::check_product instead
|
||||
|
||||
|
||||
=back
|
||||
|
||||
=head1 SEE ALSO
|
||||
|
||||
=over
|
||||
|
||||
L<Bugzilla::Testopia::Product>
|
||||
|
||||
L<Bugzilla::Webservice>
|
||||
|
||||
=back
|
||||
|
||||
=head1 AUTHOR
|
||||
|
||||
Greg Hendricks <ghendricks@novell.com>
|
||||
@@ -253,7 +253,7 @@ sub attach_bug {
|
||||
}
|
||||
eval {
|
||||
$case->attach_bug($bug_ids);
|
||||
}
|
||||
};
|
||||
if ($@){
|
||||
push @results, {FAILED => 1, message => $@};
|
||||
}
|
||||
@@ -314,7 +314,7 @@ sub add_component {
|
||||
}
|
||||
eval {
|
||||
$case->add_component($component_ids);
|
||||
}
|
||||
};
|
||||
if ($@){
|
||||
push @results, {FAILED => 1, message => $@};
|
||||
}
|
||||
@@ -375,7 +375,7 @@ sub add_tag {
|
||||
}
|
||||
eval {
|
||||
$case->add_tag($tags);
|
||||
}
|
||||
};
|
||||
if ($@){
|
||||
push @results, {FAILED => 1, message => $@};
|
||||
}
|
||||
@@ -456,7 +456,7 @@ sub link_plan {
|
||||
}
|
||||
eval {
|
||||
$case->link_plan($test_plan_id);
|
||||
}
|
||||
};
|
||||
if ($@){
|
||||
push @results, {FAILED => 1, message => $@};
|
||||
}
|
||||
@@ -468,7 +468,7 @@ sub link_plan {
|
||||
|
||||
sub unlink_plan {
|
||||
my $self = shift;
|
||||
my ($case_id, $test_plan_id) = @_;
|
||||
my ($case_id, $plan_id) = @_;
|
||||
|
||||
Bugzilla->login(LOGIN_REQUIRED);
|
||||
|
||||
@@ -477,7 +477,7 @@ sub unlink_plan {
|
||||
ThrowUserError('invalid-test-id-non-existent', {type => 'Test Case', id => $case_id}) unless $case;
|
||||
ThrowUserError("testopia-read-only", {'object' => 'case'}) unless ($case->can_unlink_plan($plan_id));
|
||||
|
||||
$case->unlink_plan($test_plan_id);
|
||||
$case->unlink_plan($plan_id);
|
||||
|
||||
# Result is list of plans for test case on success, otherwise an exception will be thrown
|
||||
return $case->plans;
|
||||
@@ -503,7 +503,7 @@ sub add_to_run {
|
||||
}
|
||||
eval {
|
||||
$case->add_to_run($run_ids);
|
||||
}
|
||||
};
|
||||
if ($@){
|
||||
push @results, {FAILED => 1, message => $@};
|
||||
}
|
||||
@@ -652,79 +652,79 @@ Provides methods for automated scripts to manipulate Testopia TestCases
|
||||
=item C<add_component($case_ids, $component_ids)>
|
||||
|
||||
Description: Adds one or more components to the selected test cases.
|
||||
|
||||
|
||||
Params: $case_ids - Integer/Array/String: An integer or alias representing the ID in the database,
|
||||
an arry of case_ids or aliases, or a string of comma separated case_ids.
|
||||
|
||||
|
||||
$component_ids - Integer/Array/String - The component ID, an array of Component IDs,
|
||||
or a comma separated list of component IDs
|
||||
|
||||
|
||||
Returns: undef/Array: undef on success or an array of hashes with failure
|
||||
codes if a failure occured.
|
||||
|
||||
|
||||
=item C<add_tag($case_ids, $tags)>
|
||||
|
||||
Description: Add one or more tags to the selected test cases.
|
||||
|
||||
|
||||
Params: $case_ids - Integer/Array/String: An integer or alias representing the ID in the database,
|
||||
an arry of case_ids or aliases, or a string of comma separated case_ids.
|
||||
|
||||
|
||||
$tags - String/Array - A single tag, an array of tags,
|
||||
or a comma separated list of tags.
|
||||
|
||||
|
||||
Returns: undef/Array: undef on success or an array of hashes with failure
|
||||
codes if a failure occured.
|
||||
|
||||
=item C<add_to_run($case_ids, $run_ids)>
|
||||
|
||||
Description: Add one or more cases to the selected test runs.
|
||||
|
||||
|
||||
Params: $case_ids - Integer/Array/String: An integer or alias representing the ID in the database,
|
||||
an arry of case_ids or aliases, or a string of comma separated case_ids.
|
||||
|
||||
|
||||
$run_ids - Integer/Array/String: An integer representing the ID in the database
|
||||
an array of IDs, or a comma separated list of IDs.
|
||||
|
||||
|
||||
Returns: undef/Array: undef on success or an array of hashes with failure
|
||||
codes if a failure occured.
|
||||
|
||||
=item C<attach_bug($case_ids, $bug_ids)>
|
||||
|
||||
Description: Add one or more bugs to the selected test cases.
|
||||
|
||||
|
||||
Params: $case_ids - Integer/Array/String: An integer or alias representing the ID in the database,
|
||||
an array of case_ids or aliases, or a string of comma separated case_ids.
|
||||
|
||||
|
||||
$bug_ids - Integer/Array/String: An integer or alias representing the ID in the database,
|
||||
an array of bug_ids or aliases, or a string of comma separated bug_ids.
|
||||
|
||||
|
||||
Returns: undef/Array: undef on success or an array of hashes with failure
|
||||
codes if a failure occured.
|
||||
|
||||
=item C<calculate_average_time($case_id)>
|
||||
|
||||
Description: Returns an average time for completion accross all runs.
|
||||
|
||||
|
||||
Params: $case_id - Integer/String: An integer or alias representing the ID in the database.
|
||||
|
||||
|
||||
Returns: String: Time in "HH:MM:SS" format.
|
||||
|
||||
=item C<check_category($name, $product)>
|
||||
|
||||
|
||||
Description: Looks up and returns a category by name.
|
||||
|
||||
|
||||
Params: $name - String: name of the category.
|
||||
$product - Integer/String/Object
|
||||
Integer: product_id of the product in the Database
|
||||
String: Product name
|
||||
Object: Blessed Bugzilla::Product object
|
||||
|
||||
|
||||
Returns: Hash: Matching Category object hash or error if not found.
|
||||
|
||||
|
||||
=item C<create($values)>
|
||||
|
||||
|
||||
Description: Creates a new Test Case object and stores it in the database.
|
||||
|
||||
|
||||
Params: $values - Hash: A reference to a hash with keys and values
|
||||
matching the fields of the test case to be created.
|
||||
+-------------------+----------------+-----------+------------------------+
|
||||
@@ -753,112 +753,112 @@ Provides methods for automated scripts to manipulate Testopia TestCases
|
||||
| plans | Array/String | Optional | String Comma separated |
|
||||
| components | Array/String | Optional | String Comma separated |
|
||||
+-------------------+----------------+-----------+------------------------+
|
||||
|
||||
|
||||
Returns: The newly created object hash.
|
||||
|
||||
|
||||
=item C<detach_bug($case_id, $bug_id)>
|
||||
|
||||
Description: Remove a bug from a test case.
|
||||
|
||||
|
||||
Params: $case_id - Integer/String: An integer or alias representing the ID in the database.
|
||||
|
||||
|
||||
$bug_ids - Integer/Array/String: An integer or alias representing the ID in the database,
|
||||
an array of bug_ids or aliases, or a string of comma separated bug_ids.
|
||||
|
||||
|
||||
Returns: 0 on success.
|
||||
|
||||
=item C<get($case_id)>
|
||||
|
||||
Description: Used to load an existing test case from the database.
|
||||
|
||||
|
||||
Params: $id - Integer/String: An integer representing the ID in the database
|
||||
or a string representing the unique alias for this case.
|
||||
|
||||
|
||||
Returns: A blessed Bugzilla::Testopia::TestCase object hash
|
||||
|
||||
|
||||
=item C<get_bugs($case_id)>
|
||||
|
||||
Description: Get the list of bugs that are associated with this test case.
|
||||
|
||||
|
||||
Params: $case_id - Integer/String: An integer representing the ID in the database
|
||||
or a string representing the unique alias for this case.
|
||||
|
||||
|
||||
Returns: Array: An array of bug object hashes.
|
||||
|
||||
|
||||
=item C<get_case_run_history($case_id)>
|
||||
|
||||
Description: Get the list of case-runs for all runs this case appears in.
|
||||
To limit this list by build or other attribute, see TestCaseRun::list.
|
||||
|
||||
|
||||
Params: $case_id - Integer/String: An integer representing the ID in the database
|
||||
or a string representing the unique alias for this case.
|
||||
|
||||
|
||||
Returns: Array: An array of case-run object hashes.
|
||||
|
||||
|
||||
=item C<get_change_history($case_id)>
|
||||
|
||||
Description: Get the list of changes to the fields of this case.
|
||||
|
||||
|
||||
Params: $case_id - Integer/String: An integer representing the ID in the database
|
||||
or a string representing the unique alias for this case.
|
||||
|
||||
|
||||
Returns: Array: An array of hashes with changed fields and their details.
|
||||
|
||||
|
||||
=item C<get_components($case_id)>
|
||||
|
||||
Description: Get the list of components attached to this case.
|
||||
|
||||
|
||||
Params: $case_id - Integer/String: An integer representing the ID in the database
|
||||
or a string representing the unique alias for this case.
|
||||
|
||||
|
||||
Returns: Array: An array of component object hashes.
|
||||
|
||||
|
||||
=item C<get_plans($case_id)>
|
||||
|
||||
Description: Get the list of plans that this case is linked to.
|
||||
|
||||
|
||||
Params: $case_id - Integer/String: An integer representing the ID in the database
|
||||
or a string representing the unique alias for this case.
|
||||
|
||||
|
||||
Returns: Array: An array of test plan object hashes.
|
||||
|
||||
|
||||
=item C<get_tags($case_id)>
|
||||
|
||||
Description: Get the list of tags attached to this case.
|
||||
|
||||
|
||||
Params: $case_id - Integer/String: An integer representing the ID in the database
|
||||
or a string representing the unique alias for this case.
|
||||
|
||||
|
||||
Returns: Array: An array of tag object hashes.
|
||||
|
||||
|
||||
=item C<get_text($case_id, $version)>
|
||||
|
||||
Description: The associated large text fields: Action, Expected Results, Setup, Breakdown
|
||||
for a given version.
|
||||
|
||||
|
||||
Params: $case_id - Integer/String: An integer representing the ID in the database
|
||||
or a string representing the unique alias for this case.
|
||||
|
||||
|
||||
$version - Integer: (OPTIONAL) The version of the text you want returned.
|
||||
Defaults to the latest.
|
||||
|
||||
|
||||
Returns: Hash: Text fields and values.
|
||||
|
||||
|
||||
=item C<link_plan($case_ids, $plan_id)>
|
||||
|
||||
Description: Link test cases to the given plan.
|
||||
|
||||
|
||||
Params: $case_ids - Integer/Array/String: An integer or alias representing the ID in the database,
|
||||
an array of case_ids or aliases, or a string of comma separated case_ids.
|
||||
|
||||
|
||||
$plan_id - Integer: An integer or alias representing the ID in the database.
|
||||
|
||||
|
||||
Returns: undef/Hash: undef on success, hash of failures if not.
|
||||
|
||||
|
||||
=item C<list($query)>
|
||||
|
||||
|
||||
Description: Performs a search and returns the resulting list of test cases.
|
||||
|
||||
|
||||
Params: $query - Hash: keys must match valid search fields.
|
||||
|
||||
+--------------------------------------------------------+
|
||||
@@ -896,7 +896,7 @@ Provides methods for automated scripts to manipulate Testopia TestCases
|
||||
| tceffect | String |
|
||||
| tceffect_type | (select from query_variants) |
|
||||
+--------------------------------------------------------+
|
||||
|
||||
|
||||
+---------------------------------------------------+
|
||||
| Paging and Sorting |
|
||||
+---------------------------------------------------+
|
||||
@@ -912,7 +912,7 @@ Provides methods for automated scripts to manipulate Testopia TestCases
|
||||
+---------------------------------------------------+
|
||||
| viewall | 1: returns all records |
|
||||
+---------------------------------------------------+
|
||||
|
||||
|
||||
+----------------------------------------------------+
|
||||
| query_variants |
|
||||
+----------------+-----------------------------------+
|
||||
@@ -926,7 +926,7 @@ Provides methods for automated scripts to manipulate Testopia TestCases
|
||||
| regexp | matches the regexp |
|
||||
| notregexp | doesn't match the regexp |
|
||||
+----------------+-----------------------------------+
|
||||
|
||||
|
||||
+-------------------------------------+
|
||||
| email_variants |
|
||||
+--------------+----------------------+
|
||||
@@ -936,7 +936,7 @@ Provides methods for automated scripts to manipulate Testopia TestCases
|
||||
| regexp | matches regexp |
|
||||
| notregexp | doesn't match regexp |
|
||||
+--------------+----------------------+
|
||||
|
||||
|
||||
+----------------------------------------------------+
|
||||
| tag_variants |
|
||||
+----------------+-----------------------------------+
|
||||
@@ -952,85 +952,85 @@ Provides methods for automated scripts to manipulate Testopia TestCases
|
||||
| anywords | contains any of the words |
|
||||
| nowords | contains none of the words |
|
||||
+----------------------------------------------------+
|
||||
|
||||
|
||||
Returns: Array: Matching test cases are retuned in a list of hashes.
|
||||
|
||||
|
||||
=item C<lookup_category_name_by_id>
|
||||
|
||||
Params: $id - Integer: ID of the case status to return
|
||||
|
||||
|
||||
Returns: String: the status name.
|
||||
|
||||
|
||||
=item C<lookup_category_id_by_name> B<DEPRICATED - CONSIDERED HARMFUL> Use check_category instead
|
||||
|
||||
|
||||
=item C<lookup_priority_name_by_id>
|
||||
|
||||
Params: $id - Integer: ID of the case status to return
|
||||
|
||||
|
||||
Returns: String: the status name.
|
||||
|
||||
|
||||
=item C<lookup_priority_id_by_name>
|
||||
|
||||
Params: $name - String: the status name.
|
||||
|
||||
|
||||
Returns: Integer: ID of the case status.
|
||||
|
||||
|
||||
=item C<lookup_status_name_by_id>
|
||||
|
||||
Params: $id - Integer: ID of the case status to return
|
||||
|
||||
|
||||
Returns: String: the status name.
|
||||
|
||||
=item C<lookup_status_id_by_name>
|
||||
|
||||
Params: $name - String: the status name.
|
||||
|
||||
|
||||
Returns: Integer: ID of the case status.
|
||||
|
||||
=item C<remove_component($case_id, $component_id)>
|
||||
|
||||
Description: Removes selected component from the selected test case.
|
||||
|
||||
|
||||
Params: $case_id - Integer/String: An integer or alias representing the ID in the database.
|
||||
|
||||
|
||||
$component_id - Integer: - The component ID to be removed.
|
||||
|
||||
|
||||
Returns: 0 on success.
|
||||
|
||||
|
||||
=item C<remove_tag($case_id, $tag)>
|
||||
|
||||
Description: Remove a tag from a case.
|
||||
|
||||
|
||||
Params: $case_id - Integer/String: An integer or alias representing the ID in the database.
|
||||
|
||||
|
||||
$tag - String - A single tag to be removed.
|
||||
|
||||
|
||||
Returns: 0 on success.
|
||||
|
||||
=item C<unlink_plan($case_id, $plan_id)>
|
||||
|
||||
Description: Unlink a test case from the given plan. If only one plan is linked, this will delete
|
||||
the test case.
|
||||
|
||||
|
||||
Params: $case_ids - Integer/String: An integer or alias representing the ID in the database.
|
||||
|
||||
|
||||
$plan_id - Integer: An integer representing the ID in the database.
|
||||
|
||||
|
||||
Returns: undef/Array: Array of plans still linked if any, undef if not.
|
||||
|
||||
|
||||
=item C<update($ids, $values)>
|
||||
|
||||
|
||||
Description: Updates the fields of the selected case or cases.
|
||||
|
||||
|
||||
Params: $ids - Integer/String/Array
|
||||
Integer: A single TestCase ID.
|
||||
String: A comma separates string of TestCase IDs for batch
|
||||
processing.
|
||||
Array: An array of case IDs for batch mode processing
|
||||
|
||||
|
||||
$values - Hash of keys matching TestCase fields and the new values
|
||||
to set each field to.
|
||||
|
||||
|
||||
Returns: Hash/Array: In the case of a single case it is returned. If a
|
||||
list was passed, it returns an array of case hashes. If the
|
||||
update on any particular case failed, the has will contain a
|
||||
@@ -1053,18 +1053,14 @@ Provides methods for automated scripts to manipulate Testopia TestCases
|
||||
| dependson | Array/String |
|
||||
| blocks | Array/String |
|
||||
+-------------------+----------------+
|
||||
|
||||
|
||||
=back
|
||||
|
||||
=head1 SEE ALSO
|
||||
|
||||
=over
|
||||
|
||||
L<Bugzilla::Testopia::TestCase>
|
||||
L<Bugzilla::Webservice>
|
||||
|
||||
=back
|
||||
|
||||
=head1 AUTHOR
|
||||
|
||||
Greg Hendricks <ghendricks@novell.com>
|
||||
@@ -105,7 +105,7 @@ sub update {
|
||||
Bugzilla->login(LOGIN_REQUIRED);
|
||||
|
||||
my @caseruns;
|
||||
my @ids = use Bugzilla::Testopia::Util::process_list($run_id);
|
||||
my @ids = Bugzilla::Testopia::Util::process_list($run_id);
|
||||
if (ref $case_id eq 'HASH' && !$build_id){
|
||||
$new_values = $case_id;
|
||||
foreach my $id (@ids){
|
||||
@@ -181,8 +181,8 @@ sub update {
|
||||
}
|
||||
|
||||
# Remove assignee user object and replace with just assignee id
|
||||
if (ref $caserun{'assignee'} eq 'Bugzilla::User'){
|
||||
$caserun{assignee} = $caserun{assignee}->id();
|
||||
if (ref $caserun->{'assignee'} eq 'Bugzilla::User'){
|
||||
$caserun->{assignee} = $caserun->{assignee}->id();
|
||||
}
|
||||
|
||||
# Result is modified test case run on success, otherwise an exception will be thrown
|
||||
@@ -264,7 +264,7 @@ sub detach_bug {
|
||||
ThrowUserError('invalid-test-id-non-existent', {type => 'Test Case Run', id => $run_id}) unless $caserun;
|
||||
ThrowUserError('testopia-read-only', {'object' => $caserun}) unless $caserun->canedit;
|
||||
|
||||
$caserun->detach_bug($bug_ids);
|
||||
$caserun->detach_bug($bug_id);
|
||||
|
||||
# Result 0 on success, otherwise an exception will be thrown
|
||||
return 0;
|
||||
@@ -321,7 +321,7 @@ Provides methods for automated scripts to manipulate Testopia TestCaseRuns.
|
||||
Test case-runs are the mapping of a test case in a given run for a particular
|
||||
build and environment. There are therefore two ways to refer to a given
|
||||
case-run:
|
||||
|
||||
|
||||
By ID: The unique case_run_id
|
||||
By Combination: $run_id, $case_id, $build_id, $environment_id
|
||||
|
||||
@@ -340,32 +340,32 @@ TestCaseRun->get($run_id, $case_id, $build_id, $environment_id)
|
||||
=item C<attach_bug($caserun_id, $bug_ids)>
|
||||
|
||||
Description: Add one or more bugs to the selected test case-runs.
|
||||
|
||||
|
||||
Params: $case_run_id - Integer: An integer representing the ID in the database.
|
||||
|
||||
|
||||
$bug_ids - Integer/Array/String: An integer or alias representing the ID in the database,
|
||||
an array of bug_ids or aliases, or a string of comma separated bug_ids.
|
||||
|
||||
|
||||
Returns: undef.
|
||||
|
||||
=item C<attach_bug($run_id, $case_id, $build_id, $environment_id, $bug_ids)>
|
||||
|
||||
Description: Add one or more bugs to the selected test case-runs.
|
||||
|
||||
|
||||
Params: $case_id - Integer: An integer representing the ID of the test case in the database.
|
||||
$run_id - Integer: An integer representing the ID of the test run in the database.
|
||||
$build_id - Integer: An integer representing the ID of the test build in the database.
|
||||
$environment_id - Integer: An integer representing the ID of the environment in the database.
|
||||
|
||||
|
||||
$bug_ids - Integer/Array/String: An integer or alias representing the ID in the database,
|
||||
an array of bug_ids or aliases, or a string of comma separated bug_ids.
|
||||
|
||||
|
||||
Returns: undef.
|
||||
|
||||
=item C<create($values)>
|
||||
|
||||
|
||||
Description: Creates a new Test Case Run object and stores it in the database.
|
||||
|
||||
|
||||
Params: $values - Hash: A reference to a hash with keys and values
|
||||
matching the fields of the test case to be created.
|
||||
+--------------------+----------------+-----------+------------------------------------------------+
|
||||
@@ -382,18 +382,18 @@ TestCaseRun->get($run_id, $case_id, $build_id, $environment_id)
|
||||
| sortkey | Integer | Optional | a.k.a. Index |
|
||||
+--------------------+----------------+-----------+------------------------------------------------+
|
||||
Valid statuses include: IDLE, PASSED, FAILED, RUNNING, PAUSED, BLOCKED
|
||||
|
||||
|
||||
Returns: The newly created object hash.
|
||||
|
||||
|
||||
=item C<detach_bug($caserun_id, $bug_id)>
|
||||
|
||||
Description: Remove a bug from a test case-run.
|
||||
|
||||
|
||||
Params: $caserun_id - Integer: An integer representing the ID in the database.
|
||||
|
||||
|
||||
$bug_ids - Integer/Array/String: An integer or alias representing the ID in the database,
|
||||
an array of bug_ids or aliases, or a string of comma separated bug_ids.
|
||||
|
||||
|
||||
Returns: undef.
|
||||
|
||||
=item C<detach_bug($run_id, $case_id, $build_id, $environment_id, $bug_id)>
|
||||
@@ -404,98 +404,98 @@ TestCaseRun->get($run_id, $case_id, $build_id, $environment_id)
|
||||
$run_id - Integer: An integer representing the ID of the test run in the database.
|
||||
$build_id - Integer: An integer representing the ID of the test build in the database.
|
||||
$environment_id - Integer: An integer representing the ID of the environment in the database.
|
||||
|
||||
|
||||
$bug_id - Integer: An integer or alias representing the ID of
|
||||
the bug in the database,
|
||||
|
||||
|
||||
Returns: undef.
|
||||
|
||||
=item C<get($caserun_id)>
|
||||
|
||||
Description: Used to load an existing test case-run from the database.
|
||||
|
||||
|
||||
Params: $caserun_id - Integer: An integer representing the ID in
|
||||
the database for this case-run.
|
||||
|
||||
|
||||
Returns: A blessed Bugzilla::Testopia::TestCase object hash
|
||||
|
||||
|
||||
=item C<get($run_id, $case_id, $build_id, $environment_id)>
|
||||
|
||||
Description: Used to load an existing test case from the database.
|
||||
|
||||
|
||||
Params: $case_id - Integer: An integer representing the ID of the test case in the database.
|
||||
$run_id - Integer: An integer representing the ID of the test run in the database.
|
||||
$build_id - Integer: An integer representing the ID of the test build in the database.
|
||||
$environment_id - Integer: An integer representing the ID of the environment in the database.
|
||||
|
||||
|
||||
Returns: A blessed Bugzilla::Testopia::TestCase object hash
|
||||
|
||||
|
||||
=item C<get_bugs($caserun_id)>
|
||||
|
||||
Description: Get the list of bugs that are associated with this test case.
|
||||
|
||||
|
||||
Params: $caserun_id - Integer: An integer representing the ID in
|
||||
the database for this case-run.
|
||||
|
||||
|
||||
Returns: Array: An array of bug object hashes.
|
||||
|
||||
|
||||
=item C<get_bugs($run_id, $case_id, $build_id, $environment_id)>
|
||||
|
||||
Description: Get the list of bugs that are associated with this test case.
|
||||
|
||||
|
||||
Params: $case_id - Integer: An integer representing the ID of the test case in the database.
|
||||
$run_id - Integer: An integer representing the ID of the test run in the database.
|
||||
$build_id - Integer: An integer representing the ID of the test build in the database.
|
||||
$environment_id - Integer: An integer representing the ID of the environment in the database.
|
||||
|
||||
|
||||
Returns: Array: An array of bug object hashes.
|
||||
|
||||
|
||||
=item C<get_completion_time($caserun_id)>
|
||||
|
||||
Description: Get the list of components attached to this case.
|
||||
|
||||
|
||||
Params: $caserun_id - Integer: An integer representing the ID in
|
||||
the database for this case-run.
|
||||
|
||||
|
||||
Returns: Array: An array of component object hashes.
|
||||
|
||||
|
||||
=item C<get_completion_time($run_id, $case_id, $build_id, $environment_id)>
|
||||
|
||||
Description: Get the list of components attached to this case.
|
||||
|
||||
|
||||
Params: $case_id - Integer: An integer representing the ID of the test case in the database.
|
||||
$run_id - Integer: An integer representing the ID of the test run in the database.
|
||||
$build_id - Integer: An integer representing the ID of the test build in the database.
|
||||
$environment_id - Integer: An integer representing the ID of the environment in the database.
|
||||
|
||||
|
||||
Returns: Array: An array of component object hashes.
|
||||
|
||||
|
||||
=item C<get_history($caserun_id)>
|
||||
|
||||
Description: Get the list of case-runs for all runs this case appears in.
|
||||
To limit this list by build or other attribute, see TestCaseRun::list.
|
||||
|
||||
|
||||
Params: $caserun_id - Integer: An integer representing the ID in
|
||||
the database for this case-run.
|
||||
|
||||
|
||||
Returns: Array: An array of case-run object hashes.
|
||||
|
||||
|
||||
=item C<get_history($run_id, $case_id, $build_id, $environment_id)>
|
||||
|
||||
Description: Get the list of case-runs for all runs this case appears in.
|
||||
To limit this list by build or other attribute, see TestCaseRun::list.
|
||||
|
||||
|
||||
Params: $case_id - Integer: An integer representing the ID of the test case in the database.
|
||||
$run_id - Integer: An integer representing the ID of the test run in the database.
|
||||
$build_id - Integer: An integer representing the ID of the test build in the database.
|
||||
$environment_id - Integer: An integer representing the ID of the environment in the database.
|
||||
|
||||
|
||||
Returns: Array: An array of case-run object hashes.
|
||||
|
||||
|
||||
=item C<list($query)>
|
||||
|
||||
|
||||
Description: Performs a search and returns the resulting list of test cases.
|
||||
|
||||
|
||||
Params: $query - Hash: keys must match valid search fields.
|
||||
|
||||
+--------------------------------------------------------+
|
||||
@@ -537,7 +537,7 @@ TestCaseRun->get($run_id, $case_id, $build_id, $environment_id)
|
||||
| testedby | A bugzilla login (email address) |
|
||||
| testedby_type | (select from email_variants) |
|
||||
+--------------------------------------------------------+
|
||||
|
||||
|
||||
+---------------------------------------------------+
|
||||
| Paging and Sorting |
|
||||
+---------------------------------------------------+
|
||||
@@ -553,7 +553,7 @@ TestCaseRun->get($run_id, $case_id, $build_id, $environment_id)
|
||||
+---------------------------------------------------+
|
||||
| viewall | 1: returns all records |
|
||||
+---------------------------------------------------+
|
||||
|
||||
|
||||
+----------------------------------------------------+
|
||||
| query_variants |
|
||||
+----------------+-----------------------------------+
|
||||
@@ -567,7 +567,7 @@ TestCaseRun->get($run_id, $case_id, $build_id, $environment_id)
|
||||
| regexp | matches the regexp |
|
||||
| notregexp | doesn't match the regexp |
|
||||
+----------------+-----------------------------------+
|
||||
|
||||
|
||||
+-------------------------------------+
|
||||
| email_variants |
|
||||
+--------------+----------------------+
|
||||
@@ -577,7 +577,7 @@ TestCaseRun->get($run_id, $case_id, $build_id, $environment_id)
|
||||
| regexp | matches regexp |
|
||||
| notregexp | doesn't match regexp |
|
||||
+--------------+----------------------+
|
||||
|
||||
|
||||
+----------------------------------------------------+
|
||||
| tag_variants |
|
||||
+----------------+-----------------------------------+
|
||||
@@ -593,31 +593,31 @@ TestCaseRun->get($run_id, $case_id, $build_id, $environment_id)
|
||||
| anywords | contains any of the words |
|
||||
| nowords | contains none of the words |
|
||||
+----------------------------------------------------+
|
||||
|
||||
|
||||
Returns: Array: Matching test cases are retuned in a list of hashes.
|
||||
|
||||
|
||||
=item C<lookup_status_name_by_id>
|
||||
|
||||
Params: $id - Integer: ID of the case status to return
|
||||
|
||||
|
||||
Returns: String: the status name.
|
||||
|
||||
|
||||
=item C<lookup_status_id_by_name>
|
||||
|
||||
Params: $name - String: the status name.
|
||||
|
||||
|
||||
Returns: Integer: ID of the case status.
|
||||
|
||||
|
||||
=item C<update($caserun_ids, $values)>
|
||||
|
||||
|
||||
Description: Updates the fields of the selected case-runs.
|
||||
|
||||
|
||||
Params: $caserun_ids - Integer/String/Array
|
||||
Integer: A single TestCaseRun ID.
|
||||
String: A comma separates string of TestCaseRun IDs for batch
|
||||
processing.
|
||||
Array: An array of TestCaseRun IDs for batch mode processing
|
||||
|
||||
|
||||
$values - Hash of keys matching TestCaseRun fields and the new values
|
||||
to set each field to.
|
||||
+--------------------+----------------+
|
||||
@@ -631,24 +631,24 @@ TestCaseRun->get($run_id, $case_id, $build_id, $environment_id)
|
||||
| sortkey | Integer |
|
||||
| update_bugs | Boolean | 1: Reopen bugs on FAILED 0: Don't change bug status
|
||||
+--------------------+----------------+
|
||||
|
||||
|
||||
Returns: Hash/Array: In the case of a single object, it is returned. If a
|
||||
list was passed, it returns an array of object hashes. If the
|
||||
update on any particular object failed, the hash will contain a
|
||||
FAILED key and the message as to why it failed.
|
||||
|
||||
=item C<update($run_id, $case_id, $build_id, $environment_id, $values)>
|
||||
|
||||
|
||||
Description: Updates the fields of the selected case-run.
|
||||
|
||||
|
||||
Params: $case_id - Integer: An integer representing the ID of the test case in the database.
|
||||
$run_id - Integer: An integer representing the ID of the test run in the database.
|
||||
$build_id - Integer: An integer representing the ID of the test build in the database.
|
||||
$environment_id - Integer: An integer representing the ID of the environment in the database.
|
||||
|
||||
|
||||
$values - Hash of keys matching TestCaseRun fields and the new values
|
||||
to set each field to. See above.
|
||||
|
||||
|
||||
Returns: Hash/Array: In the case of a single object, it is returned. If a
|
||||
list was passed, it returns an array of object hashes. If the
|
||||
update on any particular object failed, the hash will contain a
|
||||
@@ -658,13 +658,9 @@ TestCaseRun->get($run_id, $case_id, $build_id, $environment_id)
|
||||
|
||||
=head1 SEE ALSO
|
||||
|
||||
=over
|
||||
|
||||
L<Bugzilla::Testopia::TestCaseRun>
|
||||
L<Bugzilla::Webservice>
|
||||
|
||||
=back
|
||||
|
||||
=head1 AUTHOR
|
||||
|
||||
Greg Hendricks <ghendricks@novell.com>
|
||||
@@ -32,7 +32,6 @@ use Bugzilla::Testopia::TestPlan;
|
||||
use Bugzilla::Testopia::Search;
|
||||
use Bugzilla::Testopia::Table;
|
||||
|
||||
|
||||
sub get {
|
||||
my $self = shift;
|
||||
my ($plan_id) = @_;
|
||||
@@ -244,7 +243,7 @@ sub add_tag {
|
||||
}
|
||||
eval {
|
||||
$plan->add_tag($tags);
|
||||
}
|
||||
};
|
||||
if ($@){
|
||||
push @results, {FAILED => 1, message => $@};
|
||||
}
|
||||
@@ -308,20 +307,20 @@ Provides methods for automated scripts to manipulate Testopia TestPlans
|
||||
=item C<add_tag($plan_ids, $tags)>
|
||||
|
||||
Description: Add one or more tags to the selected test plans.
|
||||
|
||||
|
||||
Params: $plan_ids - Integer/Array/String: An integer or alias representing the ID in the database,
|
||||
an arry of plan_ids or aliases, or a string of comma separated plan_ids.
|
||||
|
||||
|
||||
$tags - String/Array - A single tag, an array of tags,
|
||||
or a comma separated list of tags.
|
||||
|
||||
|
||||
Returns: undef/Array: undef on success or an array of hashes with failure
|
||||
codes if a failure occured.
|
||||
|
||||
=item C<create($values)>
|
||||
|
||||
|
||||
Description: Creates a new Test Plan object and stores it in the database.
|
||||
|
||||
|
||||
Params: $values - Hash: A reference to a hash with keys and values
|
||||
matching the fields of the test plan to be created.
|
||||
+-------------------------+----------------+-----------+------------------------------------+
|
||||
@@ -333,71 +332,71 @@ Provides methods for automated scripts to manipulate Testopia TestPlans
|
||||
| default_product_version | String | Required | |
|
||||
| isactive | Boolean | Optional | 0: Archived 1: Active (Default 1) |
|
||||
+-------------------------+----------------+-----------+------------------------------------+
|
||||
|
||||
|
||||
Returns: The newly created object hash.
|
||||
|
||||
|
||||
=item C<get($plan_id)>
|
||||
|
||||
Description: Used to load an existing test plan from the database.
|
||||
|
||||
|
||||
Params: $id - Integer/String: An integer representing the ID in the database
|
||||
for this plan.
|
||||
|
||||
|
||||
Returns: A blessed Bugzilla::Testopia::TestPlan object hash
|
||||
|
||||
|
||||
=item C<get_change_history($plan_id)>
|
||||
|
||||
Description: Get the list of changes to the fields of this plan.
|
||||
|
||||
|
||||
Params: $plan_id - Integer/String: An integer representing the ID in the database
|
||||
or a string representing the unique alias for this plan.
|
||||
|
||||
|
||||
Returns: Array: An array of hashes with changed fields and their details.
|
||||
|
||||
|
||||
=item C<get_tags($plan_id)>
|
||||
|
||||
Description: Get the list of tags attached to this plan.
|
||||
|
||||
|
||||
Params: $plan_id - Integer/String: An integer representing the ID in the database
|
||||
or a string representing the unique alias for this plan.
|
||||
|
||||
|
||||
Returns: Array: An array of tag object hashes.
|
||||
|
||||
|
||||
=item C<get_test_cases($plan_id)>
|
||||
|
||||
Description: Get the list of cases that this plan is linked to.
|
||||
|
||||
|
||||
Params: $plan_id - Integer/String: An integer representing the ID in the database
|
||||
for this plan.
|
||||
|
||||
|
||||
Returns: Array: An array of test case object hashes.
|
||||
|
||||
|
||||
=item C<get_test_runs($plan_id)>
|
||||
|
||||
Description: Get the list of runs in this plan.
|
||||
|
||||
|
||||
Params: $plan_id - Integer/String: An integer representing the ID in the database
|
||||
for this plan.
|
||||
|
||||
|
||||
Returns: Array: An array of test run object hashes.
|
||||
|
||||
|
||||
=item C<get_text($plan_id, $version)>
|
||||
|
||||
Description: The associated large text fields: Action, Expected Results, Setup, Breakdown
|
||||
for a given version.
|
||||
|
||||
|
||||
Params: $plan_id - Integer/String: An integer representing the ID in the database
|
||||
or a string representing the unique alias for this plan.
|
||||
|
||||
|
||||
$version - Integer: (OPTIONAL) The version of the text you want returned.
|
||||
Defaults to the latest.
|
||||
|
||||
|
||||
Returns: Hash: Text fields and values.
|
||||
|
||||
|
||||
=item C<list($query)>
|
||||
|
||||
|
||||
Description: Performs a search and returns the resulting list of test plans.
|
||||
|
||||
|
||||
Params: $query - Hash: keys must match valid search fields.
|
||||
|
||||
+--------------------------------------------------------+
|
||||
@@ -417,7 +416,7 @@ Provides methods for automated scripts to manipulate Testopia TestPlans
|
||||
| type_id | Integer |
|
||||
| version | String: Product version |
|
||||
+--------------------------------------------------------+
|
||||
|
||||
|
||||
+--------------------------------------------------------+
|
||||
| Paging and Sorting |
|
||||
+--------------------------------------------------------+
|
||||
@@ -433,7 +432,7 @@ Provides methods for automated scripts to manipulate Testopia TestPlans
|
||||
+--------------------------------------------------------+
|
||||
| viewall | 1: returns all records 0: first 25 |
|
||||
+--------------------------------------------------------+
|
||||
|
||||
|
||||
+----------------------------------------------------+
|
||||
| query_variants |
|
||||
+----------------+-----------------------------------+
|
||||
@@ -447,7 +446,7 @@ Provides methods for automated scripts to manipulate Testopia TestPlans
|
||||
| regexp | matches the regexp |
|
||||
| notregexp | doesn't match the regexp |
|
||||
+----------------+-----------------------------------+
|
||||
|
||||
|
||||
+-------------------------------------+
|
||||
| email_variants |
|
||||
+--------------+----------------------+
|
||||
@@ -457,7 +456,7 @@ Provides methods for automated scripts to manipulate Testopia TestPlans
|
||||
| regexp | matches regexp |
|
||||
| notregexp | doesn't match regexp |
|
||||
+--------------+----------------------+
|
||||
|
||||
|
||||
+----------------------------------------------------+
|
||||
| tag_variants |
|
||||
+----------------+-----------------------------------+
|
||||
@@ -473,37 +472,37 @@ Provides methods for automated scripts to manipulate Testopia TestPlans
|
||||
| anywords | contains any of the words |
|
||||
| nowords | contains none of the words |
|
||||
+----------------------------------------------------+
|
||||
|
||||
|
||||
Returns: Array: Matching test plans are retuned in a list of hashes.
|
||||
|
||||
|
||||
=item C<lookup_type_id_by_name>
|
||||
|
||||
Params: $name - String: the status name.
|
||||
|
||||
|
||||
Returns: Integer: ID of the plan type.
|
||||
|
||||
|
||||
=item C<lookup_type_name_by_id>
|
||||
|
||||
Params: $id - Integer: ID of the plan stype to return
|
||||
|
||||
|
||||
Returns: String: the type name.
|
||||
|
||||
=item C<remove_tag($plan_id, $tag)>
|
||||
|
||||
Description: Remove a tag from a plan.
|
||||
|
||||
|
||||
Params: $plan_id - Integer/String: An integer or alias representing the ID in the database.
|
||||
|
||||
|
||||
$tag - String - A single tag to be removed.
|
||||
|
||||
|
||||
Returns: 0 on success.
|
||||
|
||||
=item C<update($ids, $values)>
|
||||
|
||||
|
||||
Description: Updates the fields of the selected test plan.
|
||||
|
||||
|
||||
Params: $ids - Integer: A single TestPlan ID.
|
||||
|
||||
|
||||
$values - Hash of keys matching TestPlan fields and the new values
|
||||
to set each field to.
|
||||
+-------------------------+----------------+
|
||||
@@ -514,20 +513,16 @@ Provides methods for automated scripts to manipulate Testopia TestPlans
|
||||
| default_product_version | String |
|
||||
| isactive | Boolean |
|
||||
+-------------------------+----------------+
|
||||
|
||||
|
||||
Returns: Hash: The updated test plan object.
|
||||
|
||||
=back
|
||||
|
||||
=head1 SEE ALSO
|
||||
|
||||
=over
|
||||
|
||||
L<Bugzilla::Testopia::TestPlan>
|
||||
L<Bugzilla::Webservice>
|
||||
|
||||
=back
|
||||
|
||||
=head1 AUTHOR
|
||||
|
||||
Greg Hendricks <ghendricks@novell.com>
|
||||
@@ -105,11 +105,11 @@ sub update {
|
||||
ThrowUserError('testopia-read-only', {'object' => $run}) unless $run->canedit;
|
||||
|
||||
if (trim($new_values->{'build_id'}) !~ /^\d+$/ ){
|
||||
my $build = Bugzilla::Testopia::Build::check_build($new_values->{'build_id'}, $plan->product);
|
||||
my $build = Bugzilla::Testopia::Build::check_build($new_values->{'build_id'}, $run->plan->product);
|
||||
$new_values->{'build_id'} = $build->id;
|
||||
}
|
||||
if (trim($new_values->{'environment_id'}) !~ /^\d+$/ ){
|
||||
my $environment = Bugzilla::Testopia::Environment::check_environment($new_values->{'environment_id'}, $plan->product);
|
||||
my $environment = Bugzilla::Testopia::Environment::check_environment($new_values->{'environment_id'}, $run->plan->product);
|
||||
$new_values->{'environment_id'} = $environment->id;
|
||||
}
|
||||
|
||||
@@ -124,7 +124,7 @@ sub update {
|
||||
$run->set_build($new_values->{'build_id'}) if $new_values->{'build_id'};
|
||||
$run->set_environment($new_values->{'environment_id'}) if $new_values->{'environment_id'};
|
||||
$run->set_manager($new_values->{'manager_id'}) if $new_values->{'manager_id'};
|
||||
$run->set_notes($new_values->{'notes'}} if exists $cgi->{'notes'};
|
||||
$run->set_notes($new_values->{'notes'}) if exists $new_values->{'notes'};
|
||||
$run->set_stop_date($timestamp) if $new_values->{'status'};
|
||||
|
||||
$run->update();
|
||||
@@ -225,7 +225,7 @@ sub add_tag {
|
||||
}
|
||||
eval {
|
||||
$run->add_tag($tags);
|
||||
}
|
||||
};
|
||||
if ($@){
|
||||
push @results, {FAILED => 1, message => $@};
|
||||
}
|
||||
@@ -289,20 +289,20 @@ Provides methods for automated scripts to manipulate Testopia TestRuns
|
||||
=item C<add_tag($run_ids, $tags)>
|
||||
|
||||
Description: Add one or more tags to the selected test runs.
|
||||
|
||||
|
||||
Params: $run_ids - Integer/Array/String: An integer or alias representing the ID in the database,
|
||||
an arry of run_ids or aliases, or a string of comma separated run_ids.
|
||||
|
||||
|
||||
$tags - String/Array - A single tag, an array of tags,
|
||||
or a comma separated list of tags.
|
||||
|
||||
|
||||
Returns: undef/Array: undef on success or an array of hashes with failure
|
||||
codes if a failure occured.
|
||||
|
||||
=item C<create($values)>
|
||||
|
||||
|
||||
Description: Creates a new Test Run object and stores it in the database.
|
||||
|
||||
|
||||
Params: $values - Hash: A reference to a hash with keys and values
|
||||
matching the fields of the test run to be created.
|
||||
+-------------------+----------------+-----------+------------------------------------+
|
||||
@@ -318,70 +318,70 @@ Provides methods for automated scripts to manipulate Testopia TestRuns
|
||||
| notes | String | Optional | |
|
||||
| status | Integer | Optional | 0:STOPPED 1: RUNNING (default 1) |
|
||||
+-------------------+----------------+-----------+------------------------------------+
|
||||
|
||||
|
||||
Returns: The newly created object hash.
|
||||
|
||||
|
||||
=item C<get($run_id)>
|
||||
|
||||
Description: Used to load an existing test run from the database.
|
||||
|
||||
|
||||
Params: $id - Integer/String: An integer representing the ID in the database
|
||||
for this run.
|
||||
|
||||
|
||||
Returns: A blessed Bugzilla::Testopia::TestRun object hash
|
||||
|
||||
|
||||
=item C<get_change_history($run_id)>
|
||||
|
||||
Description: Get the list of changes to the fields of this run.
|
||||
|
||||
|
||||
Params: $run_id - Integer/String: An integer representing the ID in the database
|
||||
or a string representing the unique alias for this run.
|
||||
|
||||
|
||||
Returns: Array: An array of hashes with changed fields and their details.
|
||||
|
||||
|
||||
=item C<get_tags($run_id)>
|
||||
|
||||
Description: Get the list of tags attached to this run.
|
||||
|
||||
|
||||
Params: $run_id - Integer/String: An integer representing the ID in the database
|
||||
or a string representing the unique alias for this run.
|
||||
|
||||
|
||||
Returns: Array: An array of tag object hashes.
|
||||
|
||||
|
||||
=item C<get_test_case_runs($run_id, $current)>
|
||||
|
||||
Description: Get the list of cases that this run is linked to.
|
||||
|
||||
|
||||
Params: $run_id - Integer/String: An integer representing the ID in the database
|
||||
for this run.
|
||||
|
||||
|
||||
$current - Boolean: 1 to only include the current set (what is displayed
|
||||
in the web page) 0: to return all, current and historical.
|
||||
|
||||
|
||||
Returns: Array: An array of test case object hashes.
|
||||
|
||||
|
||||
=item C<get_test_cases($run_id)>
|
||||
|
||||
Description: Get the list of cases that this run is linked to.
|
||||
|
||||
|
||||
Params: $run_id - Integer/String: An integer representing the ID in the database
|
||||
for this run.
|
||||
|
||||
|
||||
Returns: Array: An array of test case object hashes.
|
||||
|
||||
|
||||
=item C<get_test_plan($run_id)>
|
||||
|
||||
Description: Get the plan that this run is associated with.
|
||||
|
||||
|
||||
Params: $run_id - Integer/String: An integer representing the ID in the database
|
||||
for this run.
|
||||
|
||||
|
||||
Returns: Hash: A plan object hash.
|
||||
|
||||
|
||||
=item C<list($query)>
|
||||
|
||||
|
||||
Description: Performs a search and returns the resulting list of test runs.
|
||||
|
||||
|
||||
Params: $query - Hash: keys must match valid search fields.
|
||||
|
||||
+--------------------------------------------------------+
|
||||
@@ -409,7 +409,7 @@ Provides methods for automated scripts to manipulate Testopia TestRuns
|
||||
| type_id | Integer |
|
||||
| version | String: Product version |
|
||||
+--------------------------------------------------------+
|
||||
|
||||
|
||||
+--------------------------------------------------------+
|
||||
| Paging and Sorting |
|
||||
+--------------------------------------------------------+
|
||||
@@ -425,7 +425,7 @@ Provides methods for automated scripts to manipulate Testopia TestRuns
|
||||
+--------------------------------------------------------+
|
||||
| viewall | 1: returns all records 0: first 25 |
|
||||
+--------------------------------------------------------+
|
||||
|
||||
|
||||
+----------------------------------------------------+
|
||||
| query_variants |
|
||||
+----------------+-----------------------------------+
|
||||
@@ -439,7 +439,7 @@ Provides methods for automated scripts to manipulate Testopia TestRuns
|
||||
| regexp | matches the regexp |
|
||||
| notregexp | doesn't match the regexp |
|
||||
+----------------+-----------------------------------+
|
||||
|
||||
|
||||
+-------------------------------------+
|
||||
| email_variants |
|
||||
+--------------+----------------------+
|
||||
@@ -449,7 +449,7 @@ Provides methods for automated scripts to manipulate Testopia TestRuns
|
||||
| regexp | matches regexp |
|
||||
| notregexp | doesn't match regexp |
|
||||
+--------------+----------------------+
|
||||
|
||||
|
||||
+----------------------------------------------------+
|
||||
| tag_variants |
|
||||
+----------------+-----------------------------------+
|
||||
@@ -465,25 +465,25 @@ Provides methods for automated scripts to manipulate Testopia TestRuns
|
||||
| anywords | contains any of the words |
|
||||
| nowords | contains none of the words |
|
||||
+----------------------------------------------------+
|
||||
|
||||
|
||||
Returns: Array: Matching test runs are retuned in a list of hashes.
|
||||
|
||||
|
||||
=item C<remove_tag($run_id, $tag)>
|
||||
|
||||
Description: Remove a tag from a run.
|
||||
|
||||
|
||||
Params: $run_id - Integer/String: An integer or alias representing the ID in the database.
|
||||
|
||||
|
||||
$tag - String - A single tag to be removed.
|
||||
|
||||
|
||||
Returns: 0 on success.
|
||||
|
||||
=item C<update($ids, $values)>
|
||||
|
||||
|
||||
Description: Updates the fields of the selected test run.
|
||||
|
||||
|
||||
Params: $ids - Integer: A single TestRun ID.
|
||||
|
||||
|
||||
$values - Hash of keys matching TestRun fields and the new values
|
||||
to set each field to. See L<create> for description
|
||||
+-------------------+----------------+
|
||||
@@ -499,20 +499,16 @@ Provides methods for automated scripts to manipulate Testopia TestRuns
|
||||
| notes | String |
|
||||
| status | Integer |
|
||||
+-------------------+----------------+
|
||||
|
||||
|
||||
Returns: Hash: The updated test run object.
|
||||
|
||||
=back
|
||||
|
||||
=head1 SEE ALSO
|
||||
|
||||
=over
|
||||
|
||||
L<Bugzilla::Testopia::TestRun>
|
||||
L<Bugzilla::Webservice>
|
||||
|
||||
=back
|
||||
|
||||
=head1 AUTHOR
|
||||
|
||||
Greg Hendricks <ghendricks@novell.com>
|
||||
@@ -29,8 +29,8 @@
|
||||
You are not authorized to delete [% object.type FILTER html %] [% object.id FILTER html %]
|
||||
[% IF user.in_group('admin') %]
|
||||
If you are the administrator, you can check that your installation
|
||||
allows deletion of Testopia objects in the
|
||||
<a href="editparams.cgi">paramaters </a>.
|
||||
allows deletion of Testopia objects in the <a href="editparams.cgi">paramaters </a>
|
||||
and then add delete rights to your plan on the "Permissions" tab.
|
||||
[% END %]
|
||||
[% ELSIF error == "testopia-create-denied" %]
|
||||
[% title = "Cannot Create Object" %]
|
||||
@@ -152,5 +152,12 @@
|
||||
[% ELSIF error == "testopia-regexp-too-inclusive" %]
|
||||
You are attempting to allow access to your test plan to more people than the limit set by your administrator allows.
|
||||
Please contatct your administrator.
|
||||
[% ELSIF error == "testopia-unknown-tab" %]
|
||||
I don't know what a [% tab FILTER html %] is.
|
||||
[% ELSIF error == "testopia_component_attached" %]
|
||||
The component you are attemting to add is already attached to this case.
|
||||
[% ELSIF error == "testopia-no-action" %]
|
||||
I give up. What were you trying to do?
|
||||
Either there was no action specified, or I didn't recognize it.
|
||||
[% END %]
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
<a href="tr_query.cgi?current_tab=case">Search existing test cases</a><br>
|
||||
<a href="tr_admin_environment.cgi">Manage run environments</a></p>
|
||||
[% ELSE %]
|
||||
You must <a href="[% script_name FILTER html %]">login to Bugzilla</a> to see Testopia features.
|
||||
You must <a href="relogin.cgi">login to [% terms.Bugzilla %]</a> to see Testopia features.
|
||||
[% END %]
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
#
|
||||
# Contributor(s): Greg Hendricks <ghendricks@novell.com>
|
||||
# Scott Sudweeks <ssudweeks@novell.com>
|
||||
# Andrew Nelson <anelson@novell.com>
|
||||
# Andrew Nelson <anelson@novell.com>
|
||||
#%]
|
||||
|
||||
[%# INTERFACE:
|
||||
@@ -85,60 +85,60 @@ Ext.onReady(function(){
|
||||
loader: new Tree.TreeLoader({
|
||||
url: "tr_show_environment.cgi",
|
||||
listeners: {'beforeload':function(l, node) {
|
||||
l.baseParams.action = 'getChildren';
|
||||
l.baseParams.id = node.attributes.id;
|
||||
l.baseParams.type = node.attributes.type;
|
||||
l.baseParams.env_id = node.attributes.id;
|
||||
l.baseParams.environmentPanel = 'true';
|
||||
l.baseParams.environmentId = '[% environment.id %]';
|
||||
l.baseParams.action = 'getChildren';
|
||||
l.baseParams.id = node.attributes.id;
|
||||
l.baseParams.type = node.attributes.type;
|
||||
l.baseParams.env_id = node.attributes.id;
|
||||
l.baseParams.environmentPanel = 'true';
|
||||
l.baseParams.environmentId = '[% environment.id %]';
|
||||
}}
|
||||
}),
|
||||
listeners:{
|
||||
"textchange": function(node, text, oldText){
|
||||
var httpRequest = new Ext.data.Connection();
|
||||
httpRequest.request({
|
||||
url: 'tr_show_environment.cgi',
|
||||
params:{
|
||||
action: 'rename',
|
||||
name: text,
|
||||
env_id: node.id,
|
||||
isactive: true
|
||||
},
|
||||
success:function(object){
|
||||
TestopiaUtil.notify.msg('Test Environment updated', 'Environment renamed successfully');
|
||||
},
|
||||
failure: testopiaError
|
||||
});
|
||||
var httpRequest = new Ext.data.Connection();
|
||||
httpRequest.request({
|
||||
url: 'tr_show_environment.cgi',
|
||||
params:{
|
||||
action: 'rename',
|
||||
name: text,
|
||||
env_id: node.id,
|
||||
isactive: true
|
||||
},
|
||||
success:function(object){
|
||||
TestopiaUtil.notify.msg('Test Environment updated', 'Environment renamed successfully');
|
||||
},
|
||||
failure: testopiaError
|
||||
});
|
||||
},
|
||||
"contextmenu": function(node, event){
|
||||
if(node.attributes.type == 'category' || node.attributes.type == 'element'){
|
||||
var context = new Ext.menu.Menu({
|
||||
id: 'context menu',
|
||||
items: [{
|
||||
text: 'Remove ' + node.attributes.text,
|
||||
id: node.attributes.id,
|
||||
type: node.attributes.type,
|
||||
handler: deleteNode
|
||||
}]
|
||||
});
|
||||
}
|
||||
else if(node.attributes.type == 'validexp'){
|
||||
var context = new Ext.menu.Menu({
|
||||
id: 'context menu',
|
||||
items: [{
|
||||
text: 'Select ' + node.attributes.text,
|
||||
id: node.attributes.id,
|
||||
type: node.attributes.type,
|
||||
value: node.attributes.value,
|
||||
handler: changeNode
|
||||
}]
|
||||
});
|
||||
}
|
||||
|
||||
else
|
||||
return;
|
||||
|
||||
context.showAt([event.getPageX(), event.getPageY()]);
|
||||
"contextmenu": function(node, event){
|
||||
if(node.attributes.type == 'category' || node.attributes.type == 'element'){
|
||||
var context = new Ext.menu.Menu({
|
||||
id: 'context menu',
|
||||
items: [{
|
||||
text: 'Remove ' + node.attributes.text,
|
||||
id: node.attributes.id,
|
||||
type: node.attributes.type,
|
||||
handler: deleteNode
|
||||
}]
|
||||
});
|
||||
}
|
||||
else if(node.attributes.type == 'validexp'){
|
||||
var context = new Ext.menu.Menu({
|
||||
id: 'context menu',
|
||||
items: [{
|
||||
text: 'Select ' + node.attributes.text,
|
||||
id: node.attributes.id,
|
||||
type: node.attributes.type,
|
||||
value: node.attributes.value,
|
||||
handler: changeNode
|
||||
}]
|
||||
});
|
||||
}
|
||||
|
||||
else
|
||||
return;
|
||||
|
||||
context.showAt([event.getPageX(), event.getPageY()]);
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -162,10 +162,10 @@ Ext.onReady(function(){
|
||||
loader: new Tree.TreeLoader({
|
||||
url: "tr_show_environment.cgi",
|
||||
listeners: {"beforeload": function(l, node) {
|
||||
l.baseParams.action = 'getChildren';
|
||||
l.baseParams.id = node.attributes.id;
|
||||
l.baseParams.type = node.attributes.type;
|
||||
l.baseParams.env_id = node.attributes.id;
|
||||
l.baseParams.action = 'getChildren';
|
||||
l.baseParams.id = node.attributes.id;
|
||||
l.baseParams.type = node.attributes.type;
|
||||
l.baseParams.env_id = node.attributes.id;
|
||||
}}
|
||||
}),
|
||||
root: new Tree.AsyncTreeNode({
|
||||
@@ -178,29 +178,29 @@ Ext.onReady(function(){
|
||||
}),
|
||||
listeners: {
|
||||
"textchange": function(node, text, oldText){
|
||||
var nodeText = node.text;
|
||||
var id = node.attributes.id;
|
||||
var type = node.attributes.type;
|
||||
var httpRequest = new Ext.data.Connection();
|
||||
|
||||
httpRequest.request({
|
||||
url: 'tr_show_environment.cgi',
|
||||
params:{
|
||||
action: 'edit',
|
||||
text: text,
|
||||
id: id,
|
||||
type:type,
|
||||
value: oldText,
|
||||
isactive: true
|
||||
},
|
||||
success:function(object){
|
||||
if(object.responseText != "action successful")
|
||||
Ext.MessageBox.alert("response", object.responseText);
|
||||
},
|
||||
failure:function(){
|
||||
alert("Failure");
|
||||
}
|
||||
});
|
||||
var nodeText = node.text;
|
||||
var id = node.attributes.id;
|
||||
var type = node.attributes.type;
|
||||
var httpRequest = new Ext.data.Connection();
|
||||
|
||||
httpRequest.request({
|
||||
url: 'tr_show_environment.cgi',
|
||||
params:{
|
||||
action: 'edit',
|
||||
text: text,
|
||||
id: id,
|
||||
type:type,
|
||||
value: oldText,
|
||||
isactive: true
|
||||
},
|
||||
success:function(object){
|
||||
if(object.responseText != "action successful")
|
||||
Ext.MessageBox.alert("response", object.responseText);
|
||||
},
|
||||
failure:function(){
|
||||
alert("Failure");
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
@@ -226,349 +226,349 @@ Ext.onReady(function(){
|
||||
* Functions
|
||||
*/
|
||||
function deleteNode(item){
|
||||
if(item.type == 'category' || item.type == 'element'){
|
||||
var node = etree.getNodeById(item.id);
|
||||
if(item.type == 'category'){
|
||||
node.expand(false, true, expandCallBack);
|
||||
return;
|
||||
}
|
||||
|
||||
else if(item.type == 'element'){
|
||||
if(node.getDepth() > 2){
|
||||
Ext.MessageBox.alert("response", "only first-level elements can be deleted from your environment");
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
else{
|
||||
Ext.MessageBox.alert("response", "only first-level elements can be deleted from your environment");
|
||||
return;
|
||||
}
|
||||
if(item.type == 'category' || item.type == 'element'){
|
||||
var node = etree.getNodeById(item.id);
|
||||
if(item.type == 'category'){
|
||||
node.expand(false, true, expandCallBack);
|
||||
return;
|
||||
}
|
||||
|
||||
else if(item.type == 'element'){
|
||||
if(node.getDepth() > 2){
|
||||
Ext.MessageBox.alert("response", "only first-level elements can be deleted from your environment");
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
else{
|
||||
Ext.MessageBox.alert("response", "only first-level elements can be deleted from your environment");
|
||||
return;
|
||||
}
|
||||
|
||||
var httpRequest = new Ext.data.Connection();
|
||||
|
||||
httpRequest.request({
|
||||
url: 'tr_show_environment.cgi',
|
||||
params:{
|
||||
action: 'removeNode',
|
||||
id: item.id,
|
||||
type: item.type,
|
||||
isactive: true,
|
||||
environmentId: [% environment.id %]
|
||||
},
|
||||
success:function(object){
|
||||
if(object.responseText != "action successful")
|
||||
{
|
||||
Ext.MessageBox.alert("response", object.responseText);
|
||||
return;
|
||||
}
|
||||
|
||||
var node = etree.getNodeById(item.id);
|
||||
if(node != null)
|
||||
node.remove();
|
||||
|
||||
},
|
||||
failure:function(){
|
||||
alert("Failure");
|
||||
}
|
||||
});
|
||||
var httpRequest = new Ext.data.Connection();
|
||||
|
||||
httpRequest.request({
|
||||
url: 'tr_show_environment.cgi',
|
||||
params:{
|
||||
action: 'removeNode',
|
||||
id: item.id,
|
||||
type: item.type,
|
||||
isactive: true,
|
||||
environmentId: [% environment.id %]
|
||||
},
|
||||
success:function(object){
|
||||
if(object.responseText != "action successful")
|
||||
{
|
||||
Ext.MessageBox.alert("response", object.responseText);
|
||||
return;
|
||||
}
|
||||
|
||||
var node = etree.getNodeById(item.id);
|
||||
if(node != null)
|
||||
node.remove();
|
||||
|
||||
},
|
||||
failure:function(){
|
||||
alert("Failure");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function changeNode(item){
|
||||
var httpRequest = new Ext.data.Connection();
|
||||
|
||||
httpRequest.request({
|
||||
url: 'tr_show_environment.cgi',
|
||||
params:{
|
||||
action: 'set_selected',
|
||||
id: item.id,
|
||||
type: item.type,
|
||||
isactive: true,
|
||||
environmentId: [% environment.id %],
|
||||
value: item.value
|
||||
},
|
||||
success:function(object){
|
||||
if(object.responseText != "action successful"){
|
||||
Ext.MessageBox.alert("response", object.responseText);
|
||||
return;
|
||||
}
|
||||
|
||||
var node = etree.getNodeById(item.id);
|
||||
var parentNode = node.parentNode;
|
||||
var children = parentNode.childNodes;
|
||||
for(i=0; i<children.length; i++){
|
||||
var c = children[i].getUI();
|
||||
c.removeClass(["validexpYellow"]);
|
||||
c.addClass(["validexp"]);
|
||||
}
|
||||
var c = node.getUI();
|
||||
c.removeClass(["validexp"]);
|
||||
c.addClass(["validexpYellow"]);
|
||||
},
|
||||
failure:function(){
|
||||
alert("Failure");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
var httpRequest = new Ext.data.Connection();
|
||||
|
||||
httpRequest.request({
|
||||
url: 'tr_show_environment.cgi',
|
||||
params:{
|
||||
action: 'set_selected',
|
||||
id: item.id,
|
||||
type: item.type,
|
||||
isactive: true,
|
||||
environmentId: [% environment.id %],
|
||||
value: item.value
|
||||
},
|
||||
success:function(object){
|
||||
if(object.responseText != "action successful"){
|
||||
Ext.MessageBox.alert("response", object.responseText);
|
||||
return;
|
||||
}
|
||||
|
||||
var node = etree.getNodeById(item.id);
|
||||
var parentNode = node.parentNode;
|
||||
var children = parentNode.childNodes;
|
||||
for(i=0; i<children.length; i++){
|
||||
var c = children[i].getUI();
|
||||
c.removeClass(["validexpYellow"]);
|
||||
c.addClass(["validexp"]);
|
||||
}
|
||||
var c = node.getUI();
|
||||
c.removeClass(["validexp"]);
|
||||
c.addClass(["validexpYellow"]);
|
||||
},
|
||||
failure:function(){
|
||||
alert("Failure");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function expandCallBack(node){
|
||||
var children = node.childNodes;
|
||||
for(i=0;i<children.length;i++){
|
||||
var child = children[i];
|
||||
checkAndRemoveNode(child);
|
||||
}
|
||||
node.remove();
|
||||
return;
|
||||
var children = node.childNodes;
|
||||
for(i=0;i<children.length;i++){
|
||||
var child = children[i];
|
||||
checkAndRemoveNode(child);
|
||||
}
|
||||
node.remove();
|
||||
return;
|
||||
}
|
||||
|
||||
function checkAndRemoveNode(node){
|
||||
if(node.attributes.type != 'element')
|
||||
return;
|
||||
if(node.getDepth() > 2)
|
||||
return;
|
||||
|
||||
var item = {};
|
||||
item.id = node.attributes.id;
|
||||
item.type = node.attributes.type;
|
||||
deleteNode(item);
|
||||
if(node.attributes.type != 'element')
|
||||
return;
|
||||
if(node.getDepth() > 2)
|
||||
return;
|
||||
|
||||
var item = {};
|
||||
item.id = node.attributes.id;
|
||||
item.type = node.attributes.type;
|
||||
deleteNode(item);
|
||||
}
|
||||
|
||||
vtree.on("contextmenu", function(node, event){
|
||||
|
||||
if(node.attributes.type == 'product'){
|
||||
var context = new Ext.menu.Menu({
|
||||
id: 'context menu',
|
||||
items: [{
|
||||
text: 'Add category to ' + node.attributes.text,
|
||||
nodeId: node.attributes.id,
|
||||
type: node.attributes.type,
|
||||
handler: addNode
|
||||
}]
|
||||
vtree.on("contextmenu", function(node, event){
|
||||
|
||||
if(node.attributes.type == 'product'){
|
||||
var context = new Ext.menu.Menu({
|
||||
id: 'context menu',
|
||||
items: [{
|
||||
text: 'Add category to ' + node.attributes.text,
|
||||
nodeId: node.attributes.id,
|
||||
type: node.attributes.type,
|
||||
handler: addNode
|
||||
}]
|
||||
});
|
||||
}
|
||||
|
||||
else if(node.attributes.type == 'category'){
|
||||
var context = new Ext.menu.Menu({
|
||||
id: 'context menu',
|
||||
items: [{
|
||||
text: 'Add element to ' + node.attributes.text,
|
||||
nodeId: node.attributes.id,
|
||||
type: node.attributes.type,
|
||||
handler: addNode
|
||||
},{
|
||||
text: 'Delete ' + node.attributes.text,
|
||||
nodeId: node.attributes.id,
|
||||
type: node.attributes.type,
|
||||
handler: deleteElement
|
||||
},{
|
||||
text: 'Rename ' + node.attributes.text,
|
||||
nodeId: node.attributes.id,
|
||||
type: node.attributes.type,
|
||||
handler: renameElement
|
||||
}]
|
||||
});
|
||||
}
|
||||
|
||||
else if(node.attributes.type == 'element'){
|
||||
var context = new Ext.menu.Menu({
|
||||
id: 'context menu',
|
||||
items: [{
|
||||
text: 'Add element to ' + node.attributes.text,
|
||||
nodeId: node.attributes.id,
|
||||
type: node.attributes.type,
|
||||
handler: addNode,
|
||||
property: 'false'
|
||||
},{
|
||||
text: 'Add property to ' + node.attributes.text,
|
||||
nodeId: node.attributes.id,
|
||||
type: node.attributes.type,
|
||||
handler: addNode,
|
||||
property: 'true'
|
||||
},{
|
||||
text: 'Delete ' + node.attributes.text,
|
||||
nodeId: node.attributes.id,
|
||||
type: node.attributes.type,
|
||||
handler: deleteElement
|
||||
},{
|
||||
text: 'Rename ' + node.attributes.text,
|
||||
nodeId: node.attributes.id,
|
||||
type: node.attributes.type,
|
||||
handler: renameElement
|
||||
}]
|
||||
});
|
||||
}
|
||||
|
||||
else if(node.attributes.type == 'property'){
|
||||
var context = new Ext.menu.Menu({
|
||||
id: 'context menu',
|
||||
items: [{
|
||||
text: 'Add Value to ' + node.attributes.text,
|
||||
nodeId: node.attributes.id,
|
||||
type: node.attributes.type,
|
||||
handler: addNode,
|
||||
property: 'false'
|
||||
},{
|
||||
text: 'Delete ' + node.attributes.text,
|
||||
nodeId: node.attributes.id,
|
||||
type: node.attributes.type,
|
||||
handler: deleteElement
|
||||
},{
|
||||
text: 'Rename ' + node.attributes.text,
|
||||
nodeId: node.attributes.id,
|
||||
type: node.attributes.type,
|
||||
handler: renameElement
|
||||
}]
|
||||
});
|
||||
}
|
||||
|
||||
else if(node.attributes.type == 'validexp'){
|
||||
var context = new Ext.menu.Menu({
|
||||
id: 'context menu',
|
||||
items: [{
|
||||
text: 'Delete ' + node.attributes.text,
|
||||
nodeId: node.attributes.id,
|
||||
type: node.attributes.type,
|
||||
handler: deleteElement,
|
||||
value: node.attributes.value
|
||||
},{
|
||||
text: 'Rename ' + node.attributes.text,
|
||||
nodeId: node.attributes.id,
|
||||
type: node.attributes.type,
|
||||
handler: renameElement
|
||||
}]
|
||||
});
|
||||
}
|
||||
|
||||
else
|
||||
return;
|
||||
|
||||
context.showAt([event.getPageX(), event.getPageY()]);
|
||||
|
||||
}
|
||||
|
||||
else if(node.attributes.type == 'category'){
|
||||
var context = new Ext.menu.Menu({
|
||||
id: 'context menu',
|
||||
items: [{
|
||||
text: 'Add element to ' + node.attributes.text,
|
||||
nodeId: node.attributes.id,
|
||||
type: node.attributes.type,
|
||||
handler: addNode
|
||||
},{
|
||||
text: 'Delete ' + node.attributes.text,
|
||||
nodeId: node.attributes.id,
|
||||
type: node.attributes.type,
|
||||
handler: deleteElement
|
||||
},{
|
||||
text: 'Rename ' + node.attributes.text,
|
||||
nodeId: node.attributes.id,
|
||||
type: node.attributes.type,
|
||||
handler: renameElement
|
||||
}]
|
||||
});
|
||||
}
|
||||
|
||||
else if(node.attributes.type == 'element'){
|
||||
var context = new Ext.menu.Menu({
|
||||
id: 'context menu',
|
||||
items: [{
|
||||
text: 'Add element to ' + node.attributes.text,
|
||||
nodeId: node.attributes.id,
|
||||
type: node.attributes.type,
|
||||
handler: addNode,
|
||||
property: 'false'
|
||||
},{
|
||||
text: 'Add property to ' + node.attributes.text,
|
||||
nodeId: node.attributes.id,
|
||||
type: node.attributes.type,
|
||||
handler: addNode,
|
||||
property: 'true'
|
||||
},{
|
||||
text: 'Delete ' + node.attributes.text,
|
||||
nodeId: node.attributes.id,
|
||||
type: node.attributes.type,
|
||||
handler: deleteElement
|
||||
},{
|
||||
text: 'Rename ' + node.attributes.text,
|
||||
nodeId: node.attributes.id,
|
||||
type: node.attributes.type,
|
||||
handler: renameElement
|
||||
}]
|
||||
});
|
||||
}
|
||||
|
||||
else if(node.attributes.type == 'property'){
|
||||
var context = new Ext.menu.Menu({
|
||||
id: 'context menu',
|
||||
items: [{
|
||||
text: 'Add Value to ' + node.attributes.text,
|
||||
nodeId: node.attributes.id,
|
||||
type: node.attributes.type,
|
||||
handler: addNode,
|
||||
property: 'false'
|
||||
},{
|
||||
text: 'Delete ' + node.attributes.text,
|
||||
nodeId: node.attributes.id,
|
||||
type: node.attributes.type,
|
||||
handler: deleteElement
|
||||
},{
|
||||
text: 'Rename ' + node.attributes.text,
|
||||
nodeId: node.attributes.id,
|
||||
type: node.attributes.type,
|
||||
handler: renameElement
|
||||
}]
|
||||
});
|
||||
}
|
||||
|
||||
else if(node.attributes.type == 'validexp'){
|
||||
var context = new Ext.menu.Menu({
|
||||
id: 'context menu',
|
||||
items: [{
|
||||
text: 'Delete ' + node.attributes.text,
|
||||
nodeId: node.attributes.id,
|
||||
type: node.attributes.type,
|
||||
handler: deleteElement,
|
||||
value: node.attributes.value
|
||||
},{
|
||||
text: 'Rename ' + node.attributes.text,
|
||||
nodeId: node.attributes.id,
|
||||
type: node.attributes.type,
|
||||
handler: renameElement
|
||||
}]
|
||||
});
|
||||
}
|
||||
|
||||
else
|
||||
return;
|
||||
|
||||
context.showAt([event.getPageX(), event.getPageY()]);
|
||||
|
||||
});
|
||||
|
||||
function addNode(item){
|
||||
if(item.type == 'category' || item.type == 'element' || item.type == 'product' || item.type == 'property'){
|
||||
var node = vtree.getNodeById(item.nodeId);
|
||||
}
|
||||
|
||||
else{
|
||||
Ext.MessageBox.alert("response", "Elements can only be added to categories or elements");
|
||||
return;
|
||||
}
|
||||
if(item.type == 'category' || item.type == 'element' || item.type == 'product' || item.type == 'property'){
|
||||
var node = vtree.getNodeById(item.nodeId);
|
||||
}
|
||||
|
||||
else{
|
||||
Ext.MessageBox.alert("response", "Elements can only be added to categories or elements");
|
||||
return;
|
||||
}
|
||||
|
||||
var httpRequest = new Ext.data.Connection();
|
||||
var type = item.type;
|
||||
if(type == 'element' && item.property == 'false'){
|
||||
type = 'child';
|
||||
}
|
||||
|
||||
httpRequest.request({
|
||||
url: 'tr_show_environment.cgi',
|
||||
params:{
|
||||
action: 'createChild',
|
||||
id: item.nodeId,
|
||||
type: type,
|
||||
isactive: true,
|
||||
environmentId: [% environment.id %]
|
||||
},
|
||||
success:function(object){
|
||||
var node = vtree.getNodeById(item.nodeId);
|
||||
node.leaf = false;
|
||||
var json = new Ext.data.JsonReader();
|
||||
var newNode = new Ext.tree.TreeNode(Ext.util.JSON.decode(object.responseText));
|
||||
node.appendChild(newNode);
|
||||
},
|
||||
failure:function(){
|
||||
alert("Failure");
|
||||
}
|
||||
});
|
||||
var httpRequest = new Ext.data.Connection();
|
||||
var type = item.type;
|
||||
if(type == 'element' && item.property == 'false'){
|
||||
type = 'child';
|
||||
}
|
||||
|
||||
httpRequest.request({
|
||||
url: 'tr_show_environment.cgi',
|
||||
params:{
|
||||
action: 'createChild',
|
||||
id: item.nodeId,
|
||||
type: type,
|
||||
isactive: true,
|
||||
environmentId: [% environment.id %]
|
||||
},
|
||||
success:function(object){
|
||||
var node = vtree.getNodeById(item.nodeId);
|
||||
node.leaf = false;
|
||||
var json = new Ext.data.JsonReader();
|
||||
var newNode = new Ext.tree.TreeNode(Ext.util.JSON.decode(object.responseText));
|
||||
node.appendChild(newNode);
|
||||
},
|
||||
failure:function(){
|
||||
alert("Failure");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function deleteElement(item){
|
||||
if(item.type == 'category' || item.type == 'element' || item.type == 'product' || item.type == 'property' || item.type == 'validexp'){
|
||||
var node = vtree.getNodeById(item.nodeId);
|
||||
}
|
||||
|
||||
else{
|
||||
Ext.MessageBox.alert("response", "Error handling delete");
|
||||
return;
|
||||
}
|
||||
|
||||
var httpRequest = new Ext.data.Connection();
|
||||
|
||||
httpRequest.request({
|
||||
url: 'tr_show_environment.cgi',
|
||||
params:{
|
||||
action: 'deleteElement',
|
||||
id: item.nodeId,
|
||||
type: item.type,
|
||||
isactive: true,
|
||||
environmentId: [% environment.id %],
|
||||
value: item.value
|
||||
},
|
||||
success:function(object){
|
||||
if(object.responseText == 'action successful')
|
||||
{
|
||||
var node = vtree.getNodeById(item.nodeId);
|
||||
node.remove();
|
||||
}
|
||||
|
||||
else
|
||||
Ext.MessageBox.alert("response", object.responseText);
|
||||
|
||||
},
|
||||
failure:function(){
|
||||
alert("Failure");
|
||||
}
|
||||
});
|
||||
if(item.type == 'category' || item.type == 'element' || item.type == 'product' || item.type == 'property' || item.type == 'validexp'){
|
||||
var node = vtree.getNodeById(item.nodeId);
|
||||
}
|
||||
|
||||
else{
|
||||
Ext.MessageBox.alert("response", "Error handling delete");
|
||||
return;
|
||||
}
|
||||
|
||||
var httpRequest = new Ext.data.Connection();
|
||||
|
||||
httpRequest.request({
|
||||
url: 'tr_show_environment.cgi',
|
||||
params:{
|
||||
action: 'deleteElement',
|
||||
id: item.nodeId,
|
||||
type: item.type,
|
||||
isactive: true,
|
||||
environmentId: [% environment.id %],
|
||||
value: item.value
|
||||
},
|
||||
success:function(object){
|
||||
if(object.responseText == 'action successful')
|
||||
{
|
||||
var node = vtree.getNodeById(item.nodeId);
|
||||
node.remove();
|
||||
}
|
||||
|
||||
else
|
||||
Ext.MessageBox.alert("response", object.responseText);
|
||||
|
||||
},
|
||||
failure:function(){
|
||||
alert("Failure");
|
||||
}
|
||||
});
|
||||
}
|
||||
function renameElement(item){
|
||||
var node = vtree.getNodeById(item.nodeId);
|
||||
var el = node.getUI().getTextEl();
|
||||
itemTreeEditor.startEdit(el);
|
||||
var node = vtree.getNodeById(item.nodeId);
|
||||
var el = node.getUI().getTextEl();
|
||||
itemTreeEditor.startEdit(el);
|
||||
}
|
||||
|
||||
|
||||
function copyNode(node){
|
||||
var copy = new Tree.TreeNode(Ext.apply({}, node.attributes));
|
||||
for(var i=0; i < node.childNodes.length; i++){
|
||||
n = node.childNodes[i];
|
||||
if(n){
|
||||
copy.appendChild(copyNode(n));
|
||||
}
|
||||
}
|
||||
return copy;
|
||||
var copy = new Tree.TreeNode(Ext.apply({}, node.attributes));
|
||||
for(var i=0; i < node.childNodes.length; i++){
|
||||
n = node.childNodes[i];
|
||||
if(n){
|
||||
copy.appendChild(copyNode(n));
|
||||
}
|
||||
}
|
||||
return copy;
|
||||
};
|
||||
|
||||
itemTreeEditor.on("beforestartedit", function(editor, element, value){
|
||||
if(!editor.editNode)
|
||||
return true;
|
||||
var type = editor.editNode.attributes.type;
|
||||
if(type == 'product' || type == 'classification')
|
||||
return false;
|
||||
if(!editor.editNode)
|
||||
return true;
|
||||
var type = editor.editNode.attributes.type;
|
||||
if(type == 'product' || type == 'classification')
|
||||
return false;
|
||||
});
|
||||
|
||||
environmentTreeEditor.on('beforestartedit', function(editor, element, value){
|
||||
if(editor.editNode.attributes.type != "environment")
|
||||
return false;
|
||||
return false;
|
||||
});
|
||||
|
||||
vtree.on("enddrag", function(treePanel, node, dd, e){
|
||||
var connection = new Ext.data.Connection;
|
||||
connection.request({
|
||||
url: 'tr_show_environment.cgi',
|
||||
method: 'POST',
|
||||
params: {element_id: node.id, environment_id: [%environment.id%], type: node.attributes.type, action: 'move'},
|
||||
failure: function() {
|
||||
var connection = new Ext.data.Connection;
|
||||
connection.request({
|
||||
url: 'tr_show_environment.cgi',
|
||||
method: 'POST',
|
||||
params: {element_id: node.id, environment_id: [%environment.id%], type: node.attributes.type, action: 'move'},
|
||||
failure: function() {
|
||||
Ext.Msg.alert('Status', '"the item could not be added to the list"');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}, this);
|
||||
|
||||
etree.on("beforenodedrop", function(event){
|
||||
//alert("please let it fire");
|
||||
event.dropNode = copyNode(event.dropNode);
|
||||
//alert("please let it fire");
|
||||
event.dropNode = copyNode(event.dropNode);
|
||||
});
|
||||
|
||||
|
||||
|
||||
@@ -61,7 +61,7 @@ function planAccess(o){
|
||||
|
||||
<p>
|
||||
This page allows plan managers to permit access to a test plan. By
|
||||
default, members of the <b>Testers</b> group in Bugzilla have read
|
||||
default, members of the <b>Testers</b> group in [% terms.Bugzilla %] have read
|
||||
and write access. Beyond this, login names (email addresses) that
|
||||
match a given regular expression are granted the level of permissions
|
||||
specified. Lastly, individuals can be granted additional permissions
|
||||
|
||||
@@ -54,7 +54,7 @@
|
||||
margin-bottom:10px;
|
||||
}
|
||||
.x-grid3-row .x-grid-row-checker {
|
||||
width: 18px;
|
||||
width: 18px;
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
|
||||
@@ -62,13 +62,7 @@ my $Bugzilla_login;
|
||||
my $Bugzilla_password;
|
||||
my $soapresult;
|
||||
|
||||
sub SOAP::Transport::HTTP::Client::get_basic_credentials
|
||||
{
|
||||
return $Bugzilla_login => $Bugzilla_password;
|
||||
}
|
||||
|
||||
sub show_results
|
||||
{
|
||||
sub show_results {
|
||||
my $plan;
|
||||
my $key;
|
||||
|
||||
@@ -86,8 +80,7 @@ sub show_results
|
||||
|
||||
my $result = $soapresult->result;
|
||||
|
||||
if (ref($result) eq 'ARRAY')
|
||||
{
|
||||
if (ref($result) eq 'ARRAY') {
|
||||
my $ct = 0;
|
||||
|
||||
print "Array Results (size = " . scalar(@$result). "):\n";
|
||||
@@ -102,17 +95,14 @@ sub show_results
|
||||
$ct++;
|
||||
}
|
||||
}
|
||||
elsif (ref($result) eq 'HASH')
|
||||
{
|
||||
elsif (ref($result) eq 'HASH'){
|
||||
print "Hash Results:\n";
|
||||
|
||||
foreach (keys(%$result))
|
||||
{
|
||||
foreach (keys(%$result)){
|
||||
print "$_: $$result{$_}\n";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else{
|
||||
print "Simple Result: " . $result . "\n";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -55,10 +55,10 @@ if (!$attach_id and $cgi->param('ctype') ne 'json'){
|
||||
### Edit ###
|
||||
##################
|
||||
if ($action eq 'edit') {
|
||||
print $cgi->header;
|
||||
validate_test_id($attach_id,'attachment');
|
||||
print $cgi->header;
|
||||
validate_test_id($attach_id,'attachment');
|
||||
my $attachment = Bugzilla::Testopia::Attachment->new($attach_id);
|
||||
|
||||
|
||||
ThrowUserError('testopia-permission-denied', {'object' => $attachment}) unless $attachment->canedit;
|
||||
|
||||
$attachment->set_description($cgi->param('description')) if $cgi->param('description');
|
||||
@@ -74,37 +74,37 @@ if ($action eq 'edit') {
|
||||
####################
|
||||
|
||||
elsif ($action eq 'remove') {
|
||||
print $cgi->header;
|
||||
my $item = $cgi->param('object');
|
||||
my $item_id = $cgi->param('object_id');
|
||||
print $cgi->header;
|
||||
my $item = $cgi->param('object');
|
||||
my $item_id = $cgi->param('object_id');
|
||||
my $obj;
|
||||
|
||||
if ($item eq 'case'){
|
||||
$obj = Bugzilla::Testopia::TestCase->new($item_id);
|
||||
$obj = Bugzilla::Testopia::TestCase->new($item_id);
|
||||
}
|
||||
elsif ($item eq 'plan'){
|
||||
$obj = Bugzilla::Testopia::TestPlan->new($item_id);
|
||||
$obj = Bugzilla::Testopia::TestPlan->new($item_id);
|
||||
}
|
||||
elsif ($item eq 'caserun'){
|
||||
$obj = Bugzilla::Testopia::TestCaseRun->new($item_id);
|
||||
$obj = $obj->case;
|
||||
}
|
||||
elsif ($item eq 'caserun'){
|
||||
$obj = Bugzilla::Testopia::TestCaseRun->new($item_id);
|
||||
$obj = $obj->case;
|
||||
}
|
||||
|
||||
ThrowUserError('testopia-missing-parameter', {'param' => 'case_id or plan_id'}) unless $obj;
|
||||
|
||||
foreach my $attach_id (split(',', $cgi->param('attach_ids'))){
|
||||
validate_test_id($attach_id,'attachment');
|
||||
foreach my $attach_id (split(',', $cgi->param('attach_ids'))){
|
||||
validate_test_id($attach_id,'attachment');
|
||||
my $attachment = Bugzilla::Testopia::Attachment->new($attach_id);
|
||||
|
||||
ThrowUserError('testopia-no-delete', {'object' => $attachment}) unless $attachment->canedit;
|
||||
|
||||
|
||||
ThrowUserError('testopia-no-delete', {'object' => $attachment}) unless $attachment->canedit;
|
||||
|
||||
if ($obj->type eq 'plan'){
|
||||
$attachment->unlink_plan($obj->id);
|
||||
}
|
||||
elsif ($obj->type eq 'case'){
|
||||
$attachment->unlink_case($obj->id);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
print "{success: true}";
|
||||
}
|
||||
@@ -114,9 +114,9 @@ elsif ($action eq 'remove') {
|
||||
####################
|
||||
|
||||
elsif ($action eq 'delete') {
|
||||
print $cgi->header;
|
||||
print $cgi->header;
|
||||
|
||||
validate_test_id($attach_id,'attachment');
|
||||
validate_test_id($attach_id,'attachment');
|
||||
my $attachment = Bugzilla::Testopia::Attachment->new($attach_id);
|
||||
|
||||
$vars->{'tr_message'} = "Attachment ". $attachment->description ." deleted";
|
||||
@@ -131,24 +131,24 @@ elsif ($action eq 'delete') {
|
||||
}
|
||||
elsif ($action eq 'add'){
|
||||
print $cgi->header;
|
||||
|
||||
my $item = $cgi->param('object');
|
||||
my $item_id = $cgi->param('object_id');
|
||||
|
||||
my $item = $cgi->param('object');
|
||||
my $item_id = $cgi->param('object_id');
|
||||
my $obj;
|
||||
my $att;
|
||||
if ($item eq 'case'){
|
||||
$obj = Bugzilla::Testopia::TestCase->new($item_id);
|
||||
$att->{'case_id'} = $obj->id;
|
||||
$obj = Bugzilla::Testopia::TestCase->new($item_id);
|
||||
$att->{'case_id'} = $obj->id;
|
||||
}
|
||||
elsif ($item eq 'plan'){
|
||||
$obj = Bugzilla::Testopia::TestPlan->new($item_id);
|
||||
$att->{'plan_id'} = $obj->id;
|
||||
$obj = Bugzilla::Testopia::TestPlan->new($item_id);
|
||||
$att->{'plan_id'} = $obj->id;
|
||||
}
|
||||
elsif ($item eq 'caserun'){
|
||||
$obj = Bugzilla::Testopia::TestCaseRun->new($item_id);
|
||||
$att->{'caserun_id'} = $obj->id;
|
||||
$att->{'case_id'} = $obj->case_id;
|
||||
}
|
||||
elsif ($item eq 'caserun'){
|
||||
$obj = Bugzilla::Testopia::TestCaseRun->new($item_id);
|
||||
$att->{'caserun_id'} = $obj->id;
|
||||
$att->{'case_id'} = $obj->case_id;
|
||||
}
|
||||
|
||||
ThrowUserError("testopia-read-only", {'object' => $obj}) unless $obj->canedit;
|
||||
|
||||
@@ -178,26 +178,26 @@ elsif ($action eq 'add'){
|
||||
### List ###
|
||||
################
|
||||
elsif ($action eq 'list') {
|
||||
my $format = $template->get_format("testopia/attachment/list", scalar $cgi->param('format'), scalar $cgi->param('ctype'));
|
||||
print $cgi->header;
|
||||
my $format = $template->get_format("testopia/attachment/list", scalar $cgi->param('format'), scalar $cgi->param('ctype'));
|
||||
print $cgi->header;
|
||||
|
||||
my $item = $cgi->param('object');
|
||||
my $item_id = $cgi->param('object_id');
|
||||
my $item = $cgi->param('object');
|
||||
my $item_id = $cgi->param('object_id');
|
||||
my $obj;
|
||||
|
||||
if ($item eq 'case'){
|
||||
$obj = Bugzilla::Testopia::TestCase->new($item_id);
|
||||
$obj = Bugzilla::Testopia::TestCase->new($item_id);
|
||||
}
|
||||
elsif ($item eq 'plan'){
|
||||
$obj = Bugzilla::Testopia::TestPlan->new($item_id);
|
||||
$obj = Bugzilla::Testopia::TestPlan->new($item_id);
|
||||
}
|
||||
elsif ($item eq 'caserun'){
|
||||
$obj = Bugzilla::Testopia::TestCaseRun->new($item_id);
|
||||
}
|
||||
|
||||
my @attachments = @{$obj->attachments};
|
||||
|
||||
my $out = '';
|
||||
elsif ($item eq 'caserun'){
|
||||
$obj = Bugzilla::Testopia::TestCaseRun->new($item_id);
|
||||
}
|
||||
|
||||
my @attachments = @{$obj->attachments};
|
||||
|
||||
my $out = '';
|
||||
$out .= '{';
|
||||
$out .= '"totalResultsAvailable":' . scalar @attachments .',';
|
||||
$out .= '"attachment":[';
|
||||
|
||||
@@ -46,26 +46,26 @@ my $id = trim($cgi->param("id"));
|
||||
|
||||
if ($action eq 'diff')
|
||||
{
|
||||
if ($type eq 'plan')
|
||||
{
|
||||
print $cgi->header;
|
||||
|
||||
my $plan = Bugzilla::Testopia::TestPlan->new($id);
|
||||
|
||||
ThrowUserError("testopia-permission-denied", {'object' => $plan}) unless $plan->canview;
|
||||
|
||||
$vars->{'plan'} = $plan;
|
||||
$vars->{'diff'} = $plan->diff_plan_doc($cgi->param('new'),$cgi->param('old'));
|
||||
$vars->{'new'} = $cgi->param('new');
|
||||
$vars->{'old'} = $cgi->param('old');
|
||||
|
||||
$template->process("testopia/plan/history.html.tmpl", $vars)
|
||||
|| ThrowTemplateError($template->error());
|
||||
}
|
||||
elsif ($type eq 'case')
|
||||
{
|
||||
|
||||
}
|
||||
if ($type eq 'plan')
|
||||
{
|
||||
print $cgi->header;
|
||||
|
||||
my $plan = Bugzilla::Testopia::TestPlan->new($id);
|
||||
|
||||
ThrowUserError("testopia-permission-denied", {'object' => $plan}) unless $plan->canview;
|
||||
|
||||
$vars->{'plan'} = $plan;
|
||||
$vars->{'diff'} = $plan->diff_plan_doc($cgi->param('new'),$cgi->param('old'));
|
||||
$vars->{'new'} = $cgi->param('new');
|
||||
$vars->{'old'} = $cgi->param('old');
|
||||
|
||||
$template->process("testopia/plan/history.html.tmpl", $vars)
|
||||
|| ThrowTemplateError($template->error());
|
||||
}
|
||||
elsif ($type eq 'case')
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
elsif ($action eq 'showdoc'){
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
# Brian Kramer <bkramer@novell.com>
|
||||
# Michael Hight <mjhight@gmail.com>
|
||||
# Garrett Braden <gbraden@novell.com>
|
||||
# Andrew Nelson <anelson@novell.com>
|
||||
# Andrew Nelson <anelson@novell.com>
|
||||
|
||||
use strict;
|
||||
use lib ".";
|
||||
@@ -101,7 +101,7 @@ elsif ($action eq 'toggle'){
|
||||
elsif ($action eq 'rename'){
|
||||
my $env = Bugzilla::Testopia::Environment->new($env_id);
|
||||
ThrowUserError("testopia-read-only", {'object' => $env}) unless $env->canedit;
|
||||
|
||||
|
||||
$env->set_name($cgi->param('name'));
|
||||
$env->update();
|
||||
|
||||
@@ -163,8 +163,8 @@ elsif ($action eq 'getChildren'){
|
||||
|
||||
if($environmentId != undef && $type =~ /category/)
|
||||
{
|
||||
get_environmentPanel_elements($environmentId, $id);
|
||||
exit;
|
||||
get_environmentPanel_elements($environmentId, $id);
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
@@ -187,7 +187,7 @@ elsif($action eq 'removeNode'){
|
||||
my $id = $cgi->param('id');
|
||||
$id = return_numeric_value($id);
|
||||
my $type = $cgi->param('type');
|
||||
|
||||
|
||||
detaint_natural($env_id) unless $type =~ /validexp/;
|
||||
detaint_natural($id);
|
||||
trick_taint($type);
|
||||
@@ -201,7 +201,7 @@ elsif($action eq 'removeNode'){
|
||||
|
||||
if(!$env->element_is_mapped($id))
|
||||
{
|
||||
print 'the element is not mapped on this environment';
|
||||
print 'the element is not mapped on this environment';
|
||||
}
|
||||
|
||||
$env->delete_element($id);
|
||||
@@ -287,9 +287,9 @@ elsif($action eq 'move'){
|
||||
# my $element_id = $element->{'objectId'};
|
||||
# my $environment_id = $env_tree->{'objectId'};
|
||||
|
||||
my $element_id = $cgi->param('element_id');
|
||||
my $environment_id = $cgi->param('environment_id');
|
||||
my $type = $cgi->param('type');
|
||||
my $element_id = $cgi->param('element_id');
|
||||
my $environment_id = $cgi->param('environment_id');
|
||||
my $type = $cgi->param('type');
|
||||
trick_taint($element_id);
|
||||
trick_taint($environment_id);
|
||||
|
||||
@@ -298,42 +298,42 @@ elsif($action eq 'move'){
|
||||
|
||||
if($type eq "element")
|
||||
{
|
||||
my $env = Bugzilla::Testopia::Environment->new($environment_id);
|
||||
unless ($env->canedit){
|
||||
print "false";
|
||||
exit;
|
||||
}
|
||||
my $element = Bugzilla::Testopia::Environment::Element->new($element_id);
|
||||
my $properties = $element->get_properties;
|
||||
if (scalar @$properties == 0){
|
||||
my $success = $env->store_property_value(0, $element_id, "");
|
||||
}
|
||||
foreach my $property (@$properties){
|
||||
my $success = $env->store_property_value($property->{'property_id'}, $element_id, "");
|
||||
if ($success == 0){print "{error:\"error\"";exit;}
|
||||
}
|
||||
my $env = Bugzilla::Testopia::Environment->new($environment_id);
|
||||
unless ($env->canedit){
|
||||
print "false";
|
||||
exit;
|
||||
}
|
||||
my $element = Bugzilla::Testopia::Environment::Element->new($element_id);
|
||||
my $properties = $element->get_properties;
|
||||
if (scalar @$properties == 0){
|
||||
my $success = $env->store_property_value(0, $element_id, "");
|
||||
}
|
||||
foreach my $property (@$properties){
|
||||
my $success = $env->store_property_value($property->{'property_id'}, $element_id, "");
|
||||
if ($success == 0){print "{error:\"error\"";exit;}
|
||||
}
|
||||
}
|
||||
|
||||
#incoming type is a category
|
||||
else
|
||||
{
|
||||
my $env = Bugzilla::Testopia::Environment->new($environment_id);
|
||||
unless ($env->canedit){
|
||||
print "false";
|
||||
exit;
|
||||
}
|
||||
|
||||
my $category = Bugzilla::Testopia::Environment::Category->new($element_id);
|
||||
my $elements = $category->get_elements_by_category();
|
||||
|
||||
foreach my $element (@$elements)
|
||||
{
|
||||
print $element->id;
|
||||
#bless $element, Bugzilla::Testopia::Environment::Element;
|
||||
$env->store_property_value(0, $element->id, "");
|
||||
}
|
||||
|
||||
|
||||
my $env = Bugzilla::Testopia::Environment->new($environment_id);
|
||||
unless ($env->canedit){
|
||||
print "false";
|
||||
exit;
|
||||
}
|
||||
|
||||
my $category = Bugzilla::Testopia::Environment::Category->new($element_id);
|
||||
my $elements = $category->get_elements_by_category();
|
||||
|
||||
foreach my $element (@$elements)
|
||||
{
|
||||
print $element->id;
|
||||
#bless $element, Bugzilla::Testopia::Environment::Element;
|
||||
$env->store_property_value(0, $element->id, "");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
print "true";
|
||||
exit;
|
||||
@@ -382,74 +382,74 @@ sub display {
|
||||
###########################
|
||||
|
||||
sub get_environmentPanel_elements{
|
||||
my ($environmentId, $categoryId) = (@_);
|
||||
my $category = Bugzilla::Testopia::Environment::Category->new($categoryId);
|
||||
my $category_elements = $category->get_elements_by_category();
|
||||
my $environment = Bugzilla::Testopia::Environment->new($environmentId);
|
||||
my $environment_elements = $environment->get_elements_for_environment();
|
||||
|
||||
my @elements_to_be_printed;
|
||||
|
||||
my $json = new JSON;
|
||||
for my $element (@$category_elements)
|
||||
{
|
||||
for my $mapped_element (@$environment_elements)
|
||||
{
|
||||
if($element->id == $mapped_element->id)
|
||||
{
|
||||
my $leaf;
|
||||
if($element->check_for_children || $element->check_for_properties)
|
||||
{
|
||||
$leaf = 'false';
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
$leaf = 'true';
|
||||
}
|
||||
|
||||
push @elements_to_be_printed, {
|
||||
text => $element->{'name'},
|
||||
id => $element->{'element_id'},
|
||||
type => 'element',
|
||||
leaf => $leaf,
|
||||
cls =>'element',
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
print $json->objToJson(\@elements_to_be_printed);
|
||||
|
||||
my ($environmentId, $categoryId) = (@_);
|
||||
my $category = Bugzilla::Testopia::Environment::Category->new($categoryId);
|
||||
my $category_elements = $category->get_elements_by_category();
|
||||
my $environment = Bugzilla::Testopia::Environment->new($environmentId);
|
||||
my $environment_elements = $environment->get_elements_for_environment();
|
||||
|
||||
my @elements_to_be_printed;
|
||||
|
||||
my $json = new JSON;
|
||||
for my $element (@$category_elements)
|
||||
{
|
||||
for my $mapped_element (@$environment_elements)
|
||||
{
|
||||
if($element->id == $mapped_element->id)
|
||||
{
|
||||
my $leaf;
|
||||
if($element->check_for_children || $element->check_for_properties)
|
||||
{
|
||||
$leaf = 'false';
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
$leaf = 'true';
|
||||
}
|
||||
|
||||
push @elements_to_be_printed, {
|
||||
text => $element->{'name'},
|
||||
id => $element->{'element_id'},
|
||||
type => 'element',
|
||||
leaf => $leaf,
|
||||
cls =>'element',
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
print $json->objToJson(\@elements_to_be_printed);
|
||||
|
||||
}
|
||||
sub get_root_categories{
|
||||
my $category = Bugzilla::Testopia::Environment::Category->new({'id' => 0});
|
||||
my $toplevel;
|
||||
my $anyProduct = 'false';
|
||||
if (Bugzilla->params->{'useclassification'}){
|
||||
$vars->{'allhaschild'} = $category->get_all_child_count;
|
||||
my $category = Bugzilla::Testopia::Environment::Category->new({'id' => 0});
|
||||
my $toplevel;
|
||||
my $anyProduct = 'false';
|
||||
if (Bugzilla->params->{'useclassification'}){
|
||||
$vars->{'allhaschild'} = $category->get_all_child_count;
|
||||
$toplevel = Bugzilla->user->get_selectable_classifications;
|
||||
$vars->{'type'} = 'classification';
|
||||
$anyProduct = 'true';
|
||||
$vars->{'type'} = 'classification';
|
||||
$anyProduct = 'true';
|
||||
}
|
||||
else {
|
||||
$vars->{'toplevel'} = $category->get_env_product_list;
|
||||
$vars->{'type'} = 'product';
|
||||
else {
|
||||
$vars->{'toplevel'} = $category->get_env_product_list;
|
||||
$vars->{'type'} = 'product';
|
||||
}
|
||||
|
||||
my @products;
|
||||
|
||||
if ($anyProduct == 'true')
|
||||
{
|
||||
push @products, {id => '0 product', text => '-ANY PRODUCT-', type=> 'product', cls => 'classification'};
|
||||
}
|
||||
{
|
||||
push @products, {id => '0 product', text => '-ANY PRODUCT-', type=> 'product', cls => 'classification'};
|
||||
}
|
||||
foreach my $p (@$toplevel){
|
||||
push @products, {id => $p->id, text => $p->name, type=> $vars->{'type'}, cls=> 'classification'};
|
||||
}
|
||||
my $json = new JSON;
|
||||
print $json->objToJson(\@products);
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
sub get_products{
|
||||
@@ -501,9 +501,9 @@ sub get_validexp_json {
|
||||
}
|
||||
|
||||
sub return_numeric_value{
|
||||
my ($value) = (@_);
|
||||
$value =~ s/\D+//;
|
||||
return $value;
|
||||
my ($value) = (@_);
|
||||
$value =~ s/\D+//;
|
||||
return $value;
|
||||
}
|
||||
|
||||
#####################
|
||||
@@ -516,11 +516,11 @@ sub edit_category{
|
||||
my ($id) = (@_);
|
||||
$id =~ s/\D+//;
|
||||
my $category = Bugzilla::Testopia::Environment::Category->new($id);
|
||||
if($product_id)
|
||||
{
|
||||
$product_id = $category->produict_id();
|
||||
}
|
||||
return unless $category->canedit;
|
||||
if($product_id)
|
||||
{
|
||||
$product_id = $category->produict_id();
|
||||
}
|
||||
return unless $category->canedit;
|
||||
|
||||
trick_taint($name);
|
||||
detaint_natural($product_id);
|
||||
@@ -537,8 +537,8 @@ sub edit_category{
|
||||
$category->set_product($product_id);
|
||||
|
||||
if($category->check_for_elements()){
|
||||
print "error: Category has children, it CANNOT be renamed";
|
||||
exit;
|
||||
print "error: Category has children, it CANNOT be renamed";
|
||||
exit;
|
||||
}
|
||||
unless ($category->set_name($name)) {
|
||||
print 'error:Name already used. Please choose another';
|
||||
@@ -564,13 +564,13 @@ sub edit_element{
|
||||
my $element = Bugzilla::Testopia::Environment::Element->new($id);
|
||||
return unless $element->canedit;
|
||||
|
||||
#my $cat_id = $cgi->param('parentCategoryID');
|
||||
#my $parent_id = $cgi->param('parentElementID');
|
||||
#my $cat_id = $cgi->param('parentCategoryID');
|
||||
#my $parent_id = $cgi->param('parentElementID');
|
||||
my $name = $cgi->param('text');
|
||||
my $parent;
|
||||
|
||||
#detaint_natural($cat_id);
|
||||
#detaint_natural($parent_id);
|
||||
#detaint_natural($cat_id);
|
||||
#detaint_natural($parent_id);
|
||||
trick_taint($name);
|
||||
|
||||
# if ($cat_id){
|
||||
@@ -590,10 +590,10 @@ sub edit_element{
|
||||
# exit;
|
||||
# }
|
||||
|
||||
if($element->isMapped())
|
||||
if($element->isMapped())
|
||||
{
|
||||
print "The element is mapped you CANNOT edit it";
|
||||
exit;
|
||||
print "The element is mapped you CANNOT edit it";
|
||||
exit;
|
||||
}
|
||||
|
||||
unless ($element->update_element_name($name)){
|
||||
@@ -616,22 +616,22 @@ sub edit_property{
|
||||
|
||||
if($element_id)
|
||||
{
|
||||
detaint_natural($element_id);
|
||||
my $error_mode_cache = Bugzilla->error_mode;
|
||||
Bugzilla->error_mode(ERROR_MODE_DIE);
|
||||
eval{
|
||||
validate_selection($element_id, 'element_id', 'test_environment_element');
|
||||
};
|
||||
Bugzilla->error_mode($error_mode_cache);
|
||||
if ($@){
|
||||
print 'Invalid element';
|
||||
exit;
|
||||
}
|
||||
$property->set_element($element_id);
|
||||
}
|
||||
unless ($property->set_name($name)) {
|
||||
print 'Name already used. Please choose another';
|
||||
exit;
|
||||
detaint_natural($element_id);
|
||||
my $error_mode_cache = Bugzilla->error_mode;
|
||||
Bugzilla->error_mode(ERROR_MODE_DIE);
|
||||
eval{
|
||||
validate_selection($element_id, 'element_id', 'test_environment_element');
|
||||
};
|
||||
Bugzilla->error_mode($error_mode_cache);
|
||||
if ($@){
|
||||
print 'Invalid element';
|
||||
exit;
|
||||
}
|
||||
$property->set_element($element_id);
|
||||
}
|
||||
unless ($property->set_name($name)) {
|
||||
print 'Name already used. Please choose another';
|
||||
exit;
|
||||
}
|
||||
|
||||
print "action successful";
|
||||
@@ -649,20 +649,20 @@ sub edit_validexp{
|
||||
my $name = $cgi->param('text');
|
||||
trick_taint($name);
|
||||
my $expressions = $property->validexp();
|
||||
|
||||
my @newValues;
|
||||
my $matched = 1;
|
||||
foreach my $v(split /\|/, $expressions)
|
||||
{
|
||||
if($v eq $value and $matched)
|
||||
{
|
||||
$matched = 0;
|
||||
$v = $name;
|
||||
}
|
||||
push @newValues, $v;
|
||||
}
|
||||
|
||||
my $newExpression = join("|", @newValues);
|
||||
|
||||
my @newValues;
|
||||
my $matched = 1;
|
||||
foreach my $v(split /\|/, $expressions)
|
||||
{
|
||||
if($v eq $value and $matched)
|
||||
{
|
||||
$matched = 0;
|
||||
$v = $name;
|
||||
}
|
||||
push @newValues, $v;
|
||||
}
|
||||
|
||||
my $newExpression = join("|", @newValues);
|
||||
$property->update_property_validexp($newExpression);
|
||||
print "action successful";
|
||||
}
|
||||
@@ -683,10 +683,10 @@ sub add_category{
|
||||
my $new_cid = $category->store();
|
||||
|
||||
my $category_json = {text=> $category->{'name'}, id=> $new_cid . ' category', type=> 'category', leaf => 'false', cls=> 'category'};
|
||||
|
||||
my $json = new JSON;
|
||||
|
||||
print $json->objToJson($category_json);
|
||||
|
||||
my $json = new JSON;
|
||||
|
||||
print $json->objToJson($category_json);
|
||||
|
||||
|
||||
}
|
||||
@@ -713,10 +713,10 @@ sub add_element{
|
||||
my $new_eid = $element->store();
|
||||
|
||||
my $element_json = {text=> $element->{'name'}, id=> $new_eid . ' element', type=> 'element', leaf => 'false', cls=> 'element'};
|
||||
|
||||
my $json = new JSON;
|
||||
|
||||
print $json->objToJson($element_json);
|
||||
|
||||
my $json = new JSON;
|
||||
|
||||
print $json->objToJson($element_json);
|
||||
}
|
||||
|
||||
sub add_property{
|
||||
@@ -734,10 +734,10 @@ sub add_property{
|
||||
my $new_pid = $property->store();
|
||||
|
||||
my $property_json = {text=> $property->{'name'}, id=> $new_pid . ' property', type=> 'property', leaf => 'false', cls=> 'property'};
|
||||
|
||||
my $json = new JSON;
|
||||
|
||||
print $json->objToJson($property_json);
|
||||
|
||||
my $json = new JSON;
|
||||
|
||||
print $json->objToJson($property_json);
|
||||
}
|
||||
|
||||
sub add_validexp{
|
||||
@@ -763,8 +763,8 @@ sub delete_category{
|
||||
my $category = Bugzilla::Testopia::Environment::Category->new($id);
|
||||
if($category->check_for_elements())
|
||||
{
|
||||
print "You CANNOT delete a category that has children";
|
||||
return;
|
||||
print "You CANNOT delete a category that has children";
|
||||
return;
|
||||
}
|
||||
return unless $category->candelete;
|
||||
my $success = $category->obliterate;
|
||||
@@ -776,7 +776,7 @@ sub delete_element{
|
||||
my $element = Bugzilla::Testopia::Environment::Element->new($id);
|
||||
if($element->isMapped())
|
||||
{
|
||||
print "You CANNOT delete an element that is mapped";
|
||||
print "You CANNOT delete an element that is mapped";
|
||||
}
|
||||
return unless $element->candelete;
|
||||
my $success = $element->obliterate;
|
||||
@@ -797,8 +797,8 @@ sub delete_validexp{
|
||||
my $property = Bugzilla::Testopia::Environment::Property->new($id);
|
||||
if(!$property->candelete)
|
||||
{
|
||||
print "you CANNOT delete a property that is mapped";
|
||||
return;
|
||||
print "you CANNOT delete a property that is mapped";
|
||||
return;
|
||||
}
|
||||
my %values;
|
||||
foreach my $v (split /\|/, $property->validexp){
|
||||
|
||||
Reference in New Issue
Block a user