@@ -34,18 +34,6 @@ module Chrome
34
34
allow ( Service ) . to receive ( :new ) . and_return ( service )
35
35
end
36
36
37
- it 'sets the args capability' do
38
- Driver . new ( http_client : http , args : %w[ --foo=bar ] )
39
-
40
- expect ( caps [ 'goog:chromeOptions' ] [ :args ] ) . to eq ( %w[ --foo=bar ] )
41
- end
42
-
43
- it 'sets the args capability from switches' do
44
- Driver . new ( http_client : http , switches : %w[ --foo=bar ] )
45
-
46
- expect ( caps [ 'goog:chromeOptions' ] [ :args ] ) . to eq ( %w[ --foo=bar ] )
47
- end
48
-
49
37
it 'sets the proxy capabilitiy' do
50
38
proxy = Proxy . new ( http : 'localhost:1234' )
51
39
Driver . new ( http_client : http , proxy : proxy )
@@ -65,12 +53,6 @@ module Chrome
65
53
expect ( caps [ 'chrome.detach' ] ) . to be nil
66
54
end
67
55
68
- it 'sets the prefs capability' do
69
- Driver . new ( http_client : http , prefs : { foo : 'bar' } )
70
-
71
- expect ( caps [ 'goog:chromeOptions' ] [ :prefs ] ) . to eq ( foo : 'bar' )
72
- end
73
-
74
56
it 'lets the user override chrome.detach' do
75
57
Driver . new ( http_client : http , detach : true )
76
58
@@ -96,12 +78,11 @@ module Chrome
96
78
97
79
context 'with custom desired capabilities' do
98
80
subject ( :build_new_driver ) do
99
- Driver . new ( http_client : http , desired_capabilities : custom_caps , args : driver_args )
81
+ Driver . new ( http_client : http , desired_capabilities : custom_caps )
100
82
end
101
83
102
84
let ( :custom_caps ) { Remote ::Capabilities . new ( cap_opts ) }
103
85
let ( :cap_opts ) { { chrome_options : { 'foo' => 'bar' } } }
104
- let ( :driver_args ) { [ ] }
105
86
106
87
it 'takes desired capabilities' do
107
88
expect ( http ) . to receive ( :call ) do |_ , _ , payload |
@@ -112,20 +93,6 @@ module Chrome
112
93
build_new_driver
113
94
end
114
95
115
- context 'with direct arguments' do
116
- let ( :cap_opts ) { { 'goog:chromeOptions' => { args : %w[ foo bar ] } } }
117
- let ( :driver_args ) { %w[ baz ] }
118
-
119
- it 'lets direct arguments take precedence over capabilities' do
120
- expect ( http ) . to receive ( :call ) do |_ , _ , payload |
121
- expect ( payload [ :capabilities ] [ :firstMatch ] [ 0 ] [ 'goog:chromeOptions' ] [ :args ] ) . to eq ( driver_args )
122
- resp
123
- end
124
-
125
- build_new_driver
126
- end
127
- end
128
-
129
96
context 'with empty driver options' do
130
97
let ( :cap_opts ) { { 'goog:chromeOptions' => { args : %w[ foo bar ] } } }
131
98
0 commit comments