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)



Subject: Use submit_form() w/o args to submit current form
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.
--- 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"); } }
[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