aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/TestMech.pm
diff options
context:
space:
mode:
Diffstat (limited to 'perllib/FixMyStreet/TestMech.pm')
-rw-r--r--perllib/FixMyStreet/TestMech.pm20
1 files changed, 20 insertions, 0 deletions
diff --git a/perllib/FixMyStreet/TestMech.pm b/perllib/FixMyStreet/TestMech.pm
index 160b3955a..9f6b50a3e 100644
--- a/perllib/FixMyStreet/TestMech.pm
+++ b/perllib/FixMyStreet/TestMech.pm
@@ -288,6 +288,26 @@ sub extract_location {
};
}
+=head2 extract_problem_meta
+
+ $meta = $mech->extract_problem_meta;
+
+Returns the problem meta information ( submitted by, at etc ) from a
+problem report page
+
+=cut
+
+sub extract_problem_meta {
+ my $mech = shift;
+
+ my $result = scraper {
+ process 'div#side p em', 'meta', 'TEXT';
+ }
+ ->scrape( $mech->response );
+
+ return $result->{meta};
+}
+
=head2 visible_form_values
$hashref = $mech->visible_form_values( );