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.pm19
1 files changed, 19 insertions, 0 deletions
diff --git a/perllib/FixMyStreet/TestMech.pm b/perllib/FixMyStreet/TestMech.pm
index 9f6b50a3e..0965ff49c 100644
--- a/perllib/FixMyStreet/TestMech.pm
+++ b/perllib/FixMyStreet/TestMech.pm
@@ -308,6 +308,25 @@ sub extract_problem_meta {
return $result->{meta};
}
+=head2 extract_problem_title
+
+ $title = $mech->extract_problem_title;
+
+Returns the problem title from a problem report page
+
+=cut
+
+sub extract_problem_title {
+ my $mech = shift;
+
+ my $result = scraper {
+ process 'div#side h1', 'title', 'TEXT';
+ }
+ ->scrape( $mech->response );
+
+ return $result->{title};
+}
+
=head2 visible_form_values
$hashref = $mech->visible_form_values( );