Selaa lähdekoodia

fix broken test SRD test

George S. Baugh 5 vuotta sitten
vanhempi
sitoutus
152494f08b
1 muutettua tiedostoa jossa 9 lisäystä ja 2 poistoa
  1. 9 2
      t/Test-Selenium-Remote-Driver-google.t

+ 9 - 2
t/Test-Selenium-Remote-Driver-google.t

@@ -1,6 +1,9 @@
 use strict;
 use warnings;
+
 use Test::More;
+use Test::MockModule;
+
 use Test::Selenium::Remote::Driver;
 use Selenium::Remote::Mock::RemoteConnection;
 
@@ -15,12 +18,16 @@ my $harness = TestHarness->new(
 );
 my %selenium_args = %{ $harness->base_caps };
 
+use Carp::Always;
+my $selfmock = Test::MockModule->new('Selenium::Remote::Driver');
+$selfmock->redefine('new_session', sub { my $self = shift; $self->{session_id} = "58aff7be-e46c-42c0-ae5e-571ea1c1f466"  });
+
 # Try to find
 my $t = Test::Selenium::Remote::Driver->new(
     %selenium_args
 );
 $t->get_ok('http://www.google.com');
-$t->title_like(qr/Google/);
-$t->body_like(qr/Google/);
+$t->title_like(qr/Google/, 'head retrieved');
+$t->body_like(qr/Google/, 'body retrieved');
 
 done_testing();