diff options
author | Struan Donald <struan@exo.org.uk> | 2012-08-22 10:57:10 +0100 |
---|---|---|
committer | Struan Donald <struan@exo.org.uk> | 2012-08-22 10:57:10 +0100 |
commit | 2e0a4e8ec45579e4e5c9cf8aa123d5ab215b9703 (patch) | |
tree | c13e3c59b686e01460dc7960547f7e9c53c288bd /perllib/FixMyStreet/TestMech.pm | |
parent | b99c5ff97b29a27eeba52ed24385ac30388e875c (diff) | |
parent | 88a7d38dffa3dabdf0f85573b254cea9c8ab232b (diff) |
Merge remote-tracking branch 'origin/master' into fmb-read-only
Conflicts:
.gitignore
bin/make_css
conf/general.yml-example
perllib/FixMyStreet/App/Controller/Council.pm
perllib/FixMyStreet/App/Controller/Report/New.pm
perllib/FixMyStreet/Cobrand/Default.pm
templates/web/default/around/around_index.html
templates/web/default/index.html
templates/web/emptyhomes/index.html
templates/web/fixmystreet/around/around_index.html
templates/web/fixmystreet/index.html
web/fixmystreet_app_cgi.cgi
web/fixmystreet_app_fastcgi.cgi
Diffstat (limited to 'perllib/FixMyStreet/TestMech.pm')
-rw-r--r-- | perllib/FixMyStreet/TestMech.pm | 26 |
1 files changed, 4 insertions, 22 deletions
diff --git a/perllib/FixMyStreet/TestMech.pm b/perllib/FixMyStreet/TestMech.pm index dc42c1aba..2a49cc2f8 100644 --- a/perllib/FixMyStreet/TestMech.pm +++ b/perllib/FixMyStreet/TestMech.pm @@ -211,26 +211,6 @@ sub get_email { return $emails[0]; } -=head2 form_errors - - my $arrayref = $mech->form_errors; - -Find all the form errors on the current page and return them in page order as an -arrayref of TEXTs. If none found return empty arrayref. - -=cut - -sub form_errors { - my $mech = shift; - my $result = scraper { - process 'div.form-error', 'errors[]', 'TEXT'; - process 'p.form-error', 'errors[]', 'TEXT'; - process 'p.error', 'errors[]', 'TEXT'; - } - ->scrape( $mech->response ); - return $result->{errors} || []; -} - =head2 page_errors my $arrayref = $mech->page_errors; @@ -243,8 +223,7 @@ arrayref of TEXTs. If none found return empty arrayref. sub page_errors { my $mech = shift; my $result = scraper { - process 'p.error', 'errors[]', 'TEXT'; - process 'ul.error li', 'errors[]', 'TEXT'; + process 'div.form-error, p.form-error, p.error, ul.error li', 'errors[]', 'TEXT'; } ->scrape( $mech->response ); return $result->{errors} || []; @@ -327,6 +306,7 @@ sub extract_problem_meta { my $result = scraper { process 'div#side p em', 'meta', 'TEXT'; + process '.problem-header p em', 'meta', 'TEXT'; } ->scrape( $mech->response ); @@ -348,6 +328,7 @@ sub extract_problem_title { my $result = scraper { process 'div#side h1', 'title', 'TEXT'; + process '.problem-header h1', 'title', 'TEXT'; } ->scrape( $mech->response ); @@ -388,6 +369,7 @@ sub extract_update_metas { my $result = scraper { process 'div#updates div.problem-update p em', 'meta[]', 'TEXT'; + process '.update-text .meta-2', 'meta[]', 'TEXT'; } ->scrape( $mech->response ); |