File tree 1 file changed +27
-3
lines changed
rb/lib/selenium/webdriver/common
1 file changed +27
-3
lines changed Original file line number Diff line number Diff line change @@ -23,9 +23,33 @@ class Options
23
23
W3C_OPTIONS = %i[ browser_name browser_version platform_name accept_insecure_certs page_load_strategy proxy
24
24
set_window_rect timeouts unhandled_prompt_behavior strict_file_interactability ] . freeze
25
25
26
- def self . set_capabilities
27
- ( W3C_OPTIONS + self ::CAPABILITIES . keys ) . each do |key |
28
- next if method_defined? key
26
+ class << self
27
+ attr_reader :driver_path
28
+
29
+ def chrome ( **opts )
30
+ Chrome ::Options . new ( **opts )
31
+ end
32
+
33
+ def firefox ( **opts )
34
+ Firefox ::Options . new ( **opts )
35
+ end
36
+
37
+ def ie ( **opts )
38
+ IE ::Options . new ( **opts )
39
+ end
40
+ alias_method :internet_explorer , :ie
41
+
42
+ def edge ( **opts )
43
+ Edge ::Options . new ( **opts )
44
+ end
45
+
46
+ def safari ( **opts )
47
+ Safari ::Options . new ( **opts )
48
+ end
49
+
50
+ def set_capabilities
51
+ ( W3C_OPTIONS + self ::CAPABILITIES . keys ) . each do |key |
52
+ next if method_defined? key
29
53
30
54
define_method key do
31
55
@options [ key ]
You can’t perform that action at this time.
0 commit comments