File tree Expand file tree Collapse file tree
rb/lib/selenium/webdriver/common Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -23,9 +23,33 @@ class Options
2323 W3C_OPTIONS = %i[ browser_name browser_version platform_name accept_insecure_certs page_load_strategy proxy
2424 set_window_rect timeouts unhandled_prompt_behavior strict_file_interactability ] . freeze
2525
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
2953
3054 define_method key do
3155 @options [ key ]
You can’t perform that action at this time.
0 commit comments