File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ use strict;
22use warnings;
33
44use Test::More;
5+ use Test::MockModule;
56use Selenium::Remote::Driver;
67use Selenium::Remote::Mock::RemoteConnection;
78
@@ -46,11 +47,16 @@ INPUT: {
4647 ok(!$ret , ' Get attribute returns false for a missing attribute.' );
4748 $ret = $elem -> get_tag_name();
4849 is($ret , ' input' , ' Get tag name' );
50+ my $selfmock = Test::MockModule-> new(' Selenium::Remote::WebElement' );
51+ $selfmock -> redefine(' get_tag_name' ,sub { ' input' });
52+ $selfmock -> redefine(' get_property' ,sub { 0 });
4953
5054 $elem = $driver -> find_element(' checky' , ' id' );
5155 $ret = $elem -> is_selected();
5256 is($ret , 0, ' Checkbox not selected' );
5357 $ret = $elem -> click();
58+ $selfmock -> redefine(' get_property' ,sub { 1 });
59+
5460 $ret = $elem -> is_selected();
5561 is($ret , 1, ' Checkbox is selected' );
5662 TODO: {
You can’t perform that action at this time.
0 commit comments