@@ -41,20 +41,20 @@ def test_we_can_pass_options(self, driver, pages):
41
41
class TestUnit :
42
42
def test_ctor (self ):
43
43
opts = Options ()
44
- assert opts ._binary is None
45
- assert not opts ._preferences
44
+ assert opts .binary_location == ""
45
+ assert opts ._preferences == { "remote.active-protocols" : 3 }
46
46
assert opts ._profile is None
47
47
assert not opts ._arguments
48
48
assert isinstance (opts .log , Log )
49
49
50
50
def test_binary (self ):
51
51
opts = Options ()
52
- assert opts .binary is None
52
+ assert opts .binary_location == ""
53
53
54
54
other_binary = FirefoxBinary ()
55
- assert other_binary != opts .binary
55
+ assert other_binary != opts .binary_location
56
56
opts .binary = other_binary
57
- assert other_binary == opts .binary
57
+ assert other_binary . _start_cmd == opts .binary_location
58
58
59
59
path = "/path/to/binary"
60
60
opts .binary = path
@@ -63,16 +63,16 @@ def test_binary(self):
63
63
64
64
def test_prefs (self ):
65
65
opts = Options ()
66
- assert len (opts .preferences ) == 0
66
+ assert len (opts .preferences ) == 1
67
67
assert isinstance (opts .preferences , dict )
68
68
69
69
opts .set_preference ("spam" , "ham" )
70
- assert len (opts .preferences ) == 1
71
- opts .set_preference ("eggs" , True )
72
70
assert len (opts .preferences ) == 2
71
+ opts .set_preference ("eggs" , True )
72
+ assert len (opts .preferences ) == 3
73
73
opts .set_preference ("spam" , "spam" )
74
- assert len (opts .preferences ) == 2
75
- assert opts .preferences == {"spam " : "spam" , "eggs " : True }
74
+ assert len (opts .preferences ) == 3
75
+ assert opts .preferences == {"eggs " : True , "remote.active-protocols" : 3 , "spam " : "spam" }
76
76
77
77
def test_profile (self , tmpdir_factory ):
78
78
opts = Options ()
@@ -99,7 +99,12 @@ def test_arguments(self):
99
99
def test_to_capabilities (self ):
100
100
opts = Options ()
101
101
firefox_caps = DesiredCapabilities .FIREFOX .copy ()
102
- firefox_caps .update ({"pageLoadStrategy" : PageLoadStrategy .normal })
102
+ firefox_caps .update (
103
+ {
104
+ "pageLoadStrategy" : PageLoadStrategy .normal ,
105
+ "moz:firefoxOptions" : {"prefs" : {"remote.active-protocols" : 3 }},
106
+ }
107
+ )
103
108
assert opts .to_capabilities () == firefox_caps
104
109
105
110
profile = FirefoxProfile ()
0 commit comments