aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--perllib/FixMyStreet/TestMech.pm22
1 files changed, 21 insertions, 1 deletions
diff --git a/perllib/FixMyStreet/TestMech.pm b/perllib/FixMyStreet/TestMech.pm
index 0965ff49c..ecca3f7a8 100644
--- a/perllib/FixMyStreet/TestMech.pm
+++ b/perllib/FixMyStreet/TestMech.pm
@@ -312,7 +312,7 @@ sub extract_problem_meta {
$title = $mech->extract_problem_title;
-Returns the problem title from a problem report page
+Returns the problem title from a problem report page.
=cut
@@ -327,6 +327,26 @@ sub extract_problem_title {
return $result->{title};
}
+
+=head2 extract_problem_banner
+
+ $banner = $mech->extract_problem_banner;
+
+Returns the problem title from a problem report page. Returns a hashref with id and text.
+
+=cut
+
+sub extract_problem_banner {
+ my $mech = shift;
+
+ my $result = scraper {
+ process 'div#side > p', id => '@id', text => 'TEXT';
+ }
+ ->scrape( $mech->response );
+
+ return $result;
+}
+
=head2 visible_form_values
$hashref = $mech->visible_form_values( );