Subject: | Broken tests for Google pages |
Google (recently?) changed the layout of the help section of their site and the ordering of search results page titles, which broke some of the live tests in live/get.t and live/back.t.
Attached is a patch against version 1.12 (also works against 1.13_01) to bring the tests in line with the changes made by Google.
Hope this helps.
Thanks,
Evan A. Zacks
diff -ur WWW-Mechanize-1.12.orig/t/live/back.t WWW-Mechanize-1.12/t/live/back.t
--- WWW-Mechanize-1.12.orig/t/live/back.t 2004-12-20 21:10:08.000000000 -0500
+++ WWW-Mechanize-1.12/t/live/back.t 2005-08-07 14:21:02.022825720 -0400
@@ -35,7 +35,7 @@
fields => { 'q' => "perl" },
);
ok( $mech->success, "Searched for Perl" );
-like( $mech->title, qr/^Google Search: perl/, "Right page title" );
+like( $mech->title, qr/^perl - Google Search/, "Right page title" );
is( scalar @{$mech->{page_stack}}, 1, "POST is in the stack" );
$mech->head( "http://www.google.com/" );
diff -ur WWW-Mechanize-1.12.orig/t/live/get.t WWW-Mechanize-1.12/t/live/get.t
--- WWW-Mechanize-1.12.orig/t/live/get.t 2005-02-01 23:03:08.000000000 -0500
+++ WWW-Mechanize-1.12/t/live/get.t 2005-08-07 14:57:58.203914984 -0400
@@ -24,12 +24,12 @@
ok( $agent->is_html );
is( $agent->title, "Google Advertising", "Got the right page" );
-ok( $agent->get( '../help/' )->is_success, 'Got the help page' );
-is( $agent->uri, 'http://www.google.com/help/', "Got relative OK" );
+ok( $agent->get( '../support/' )->is_success, 'Got the support page' );
+is( $agent->uri, 'http://www.google.com/support/', "Got relative OK" );
ok( $agent->is_html );
-is( $agent->title, "Google Help Central", "Title matches" );
+is( $agent->title, "Google: Web Search Help Center", "Title matches" );
-ok( $agent->get( 'basics.html' )->is_success, 'Got the basics page' );
+ok( $agent->get( '../help/basics.html' )->is_success, 'Got the basics page' );
is( $agent->uri, 'http://www.google.com/help/basics.html', "Got relative OK" );
ok( $agent->is_html, "Basics page is HTML" );
is( $agent->title, "Google Help : Basics of Search", "Title matches" );