Skip Menu |
 

This queue is for tickets about the HTTP-Recorder CPAN distribution.

Report information
The Basics
Id: 6647
Status: resolved
Priority: 0/
Queue: HTTP-Recorder

People
Owner: leira [...] cpan.org
Requestors: alex [...] kapranoff.ru
Cc:
AdminCc:

Bug Information
Severity: Wishlist
Broken in: 0.03_01
Fixed in: (no value)

Attachments


Subject: Use submit_form() w/o args to submit current form
Download (untitled) / with headers
text/plain 145b
Another step in the direction of cleaner scripts. No need to submit_form by name and number after we selected that very form for fields updating.
Download patch-log.pm
text/x-perl 984b
--- Logger.pm.orig Mon Mar 1 08:31:03 2004 +++ lib/HTTP/Recorder/Logger.pm Wed Jun 16 20:43:26 2004 @@ -49,7 +49,7 @@ sub Log { my $self = shift; my $function = shift; - my $args = shift; + my $args = shift || ''; my $line = $self->{agentname} . "->$function($args);\n"; @@ -127,9 +127,7 @@ $self->SetField(name => $field, value => $args{fields}->{$field}); } - $self->Submit(name => $args{name}, - number => $args{number}, - button_name => $args{button_name}, + $self->Submit(button_name => $args{button_name}, button_value => $args{button_value}, button_number => $args{button_number}, ); @@ -171,8 +169,10 @@ # Don't add this until WWW::Mechanize supports it if ($args{name}) { $self->Log("submit_form", "form_name => \"$args{name}\""); - } else { + } elsif ($args{number}) { $self->Log("submit_form", "form_number => \"$args{number}\""); + } else { + $self->Log("submit_form"); } }
Download (untitled) / with headers
text/plain 654b
[guest - Wed Jun 16 13:13:46 2004]: Show quoted text
> Another step in the direction of cleaner scripts. No need to > submit_form by name and number after we selected that very form for > fields updating.
A cleaner script isn't always the right answer. When writing a huge suite of tests, HTTP::Recorder will be used to get you part way there, not to create the final scripts that you'll use in your testing. In that case, it's better to create more verbose scripts that can act as a placeholder for future modifications. Nonetheless, I'll think about this, and try to come up with what I think is the best answer. Thanks for the patch, in any case. Linda


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.