File tree Expand file tree Collapse file tree
lib/selenium/webdriver/edge
spec/unit/selenium/webdriver/edge Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -26,6 +26,20 @@ class Options < Chromium::Options
2626 KEY = 'ms:edgeOptions'
2727 BROWSER = 'MicrosoftEdge'
2828
29+ #
30+ # Changes the browser name enable webview2
31+ # see: https://learn.microsoft.com/en-us/microsoft-edge/webview2/how-to/webdriver
32+ # Automation of WebView2 apps with Microsoft Edge WebDriver
33+ #
34+ # @example Enable webview2
35+ # options = Selenium::WebDriver::Edge::Options.new
36+ # options.webview2!
37+ #
38+
39+ def webview2!
40+ @options [ :browser_name ] = 'webview2'
41+ end
42+
2943 private
3044
3145 def enable_logging ( browser_options )
Original file line number Diff line number Diff line change @@ -169,6 +169,13 @@ module Edge
169169 end
170170 end
171171
172+ describe 'uses webview2 for MS Edge Driver' do
173+ it 'changes browserName to webview2' do
174+ options . webview2!
175+ expect ( options . browser_name ) . to eq ( 'webview2' )
176+ end
177+ end
178+
172179 describe '#add_preference' do
173180 it 'adds a preference' do
174181 options . add_preference ( :foo , 'bar' )
You can’t perform that action at this time.
0 commit comments