[Jifty-commit] r7615 - jifty/trunk/lib/Jifty/Test/WWW
Jifty commits
jifty-commit at lists.jifty.org
Mon Nov 16 16:14:04 EST 2009
Author: sartak
Date: Mon Nov 16 16:14:02 2009
New Revision: 7615
Modified:
jifty/trunk/lib/Jifty/Test/WWW/Mechanize.pm
Log:
Refactor most of action_field_value into action_field_input
Modified: jifty/trunk/lib/Jifty/Test/WWW/Mechanize.pm
==============================================================================
--- jifty/trunk/lib/Jifty/Test/WWW/Mechanize.pm (original)
+++ jifty/trunk/lib/Jifty/Test/WWW/Mechanize.pm Mon Nov 16 16:14:02 2009
@@ -200,24 +200,37 @@
return;
}
-=head2 action_field_value MONIKER, FIELD
+=head2 action_field_input MONIKER, FIELD
-Finds the fields on the current page with the names FIELD in the
-action MONIKER, and returns its value, or undef if it can't be found.
+Finds the field on the current page with the names FIELD in the
+action MONIKER, and returns its L<HTML::Form::Input>, or undef if it can't be
+found.
=cut
-sub action_field_value {
+sub action_field_input {
my $self = shift;
my $moniker = shift;
my $field = shift;
my $action_form = $self->action_form($moniker, $field);
return unless $action_form;
-
+
my $input = $action_form->find_input("J:A:F-$field-$moniker");
- return unless $input;
- return $input->value;
+ return $input;
+}
+
+=head2 action_field_value MONIKER, FIELD
+
+Finds the field on the current page with the names FIELD in the
+action MONIKER, and returns its value, or undef if it can't be found.
+
+=cut
+
+sub action_field_value {
+ my $self = shift;
+ my $input = $self->action_field_input(@_);
+ return $input ? $input->value : undef;
}
=head2 send_action CLASS ARGUMENT => VALUE, [ ... ]
More information about the Jifty-commit
mailing list