Skip to content

Commit bf9e56f

Browse files
committed
fix broken reuse session test
1 parent 152494f commit bf9e56f

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

t/12-reuse-session.t

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ use strict;
22
use warnings;
33

44
use Test::More;
5+
use Test::MockModule;
56
use Test::Selenium::Remote::Driver;
67
use Selenium::Remote::Mock::RemoteConnection;
78

@@ -15,9 +16,15 @@ my $harness = TestHarness->new(
1516
this_file => $FindBin::Script
1617
);
1718

18-
my @browsers = qw/chrome firefox/;
19+
my @browsers = qw/chrome/;
1920

2021
foreach (@browsers) {
22+
my @mock_session_ids = qw{2257c1cf-17d9-401a-a13b-fc7a279d7db5 dddddddd-17d9-401a-a13b-fc7a279d7db5 17c83f3a-3f23-4ffc-a50f-06ba5f5202d1};
23+
24+
my $mock = Test::MockModule->new('Selenium::Remote::Driver');
25+
$mock->redefine('new_session', sub { my $s = shift; $s->{session_id} //= shift @mock_session_ids } );
26+
27+
2128
my %selenium_args = (
2229
default_finder => 'css',
2330
javascript => 1,

0 commit comments

Comments
 (0)