@@ -26,18 +26,22 @@ module IE
26
26
27
27
class Bridge < Remote ::Bridge
28
28
def initialize ( opts = { } )
29
- port = opts . delete ( :port ) || Service ::DEFAULT_PORT
30
- service_args = opts . delete ( :service_args ) || { }
31
- service_args = match_legacy ( opts , service_args )
32
- driver_path = opts . delete ( :driver_path ) || IE . driver_path
29
+ opts [ :desired_capabilities ] ||= Remote ::Capabilities . internet_explorer
33
30
34
- @service = Service . new ( driver_path , port , *extract_service_args ( service_args ) )
35
- @service . start
36
- opts [ :url ] = @service . uri
31
+ unless opts . key? ( :url )
32
+ port = opts . delete ( :port ) || Service ::DEFAULT_PORT
33
+ service_args = opts . delete ( :service_args ) || { }
34
+ service_args = match_legacy ( opts , service_args )
35
+ driver_path = opts . delete ( :driver_path ) || IE . driver_path
36
+ @service = Service . new ( driver_path , port , *extract_service_args ( service_args ) )
37
+ @service . start
38
+ opts [ :url ] = @service . uri
39
+ end
37
40
38
- caps = opts [ :desired_capabilities ] ||= Remote ::Capabilities . internet_explorer
39
- caps [ :ignore_protected_mode_settings ] = true if opts . delete ( :introduce_flakiness_by_ignoring_security_domains )
40
- caps [ :native_events ] = opts . delete ( :native_events ) != false
41
+ if opts . delete ( :introduce_flakiness_by_ignoring_security_domains )
42
+ opts [ :desired_capabilities ] [ :ignore_protected_mode_settings ] = true
43
+ end
44
+ opts [ :desired_capabilities ] [ :native_events ] = opts . delete ( :native_events ) != false
41
45
42
46
super ( opts )
43
47
end
@@ -70,6 +74,9 @@ def extract_service_args(args)
70
74
service_args << "--log-level=#{ args . delete ( :log_level ) . to_s . upcase } " if args . key? ( :log_level )
71
75
service_args << "--log-file=#{ args . delete ( :log_file ) } " if args . key? ( :log_file )
72
76
service_args << "--implementation=#{ args . delete ( :implementation ) . to_s . upcase } " if args . key? ( :implementation )
77
+ service_args << "--host=#{ args . delete ( :host ) } " if args . key? ( :host )
78
+ service_args << "--extract_path=#{ args . delete ( :extract_path ) } " if args . key? ( :extract_path )
79
+ service_args << "--silent" if args [ :silent ] == true
73
80
service_args
74
81
end
75
82
end # Bridge
0 commit comments