Skip to content

Commit

Permalink
[rb] Add deprecation annotation for headless (SeleniumHQ#11527)
Browse files Browse the repository at this point in the history
* [rb] Add deprecation annotation to Chromium headless method
* [rb] Added the same changes for firefox
  • Loading branch information
TamsilAmani committed Jan 14, 2023
1 parent 633a2f5 commit 1e9fd6d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions rb/lib/selenium/webdriver/chromium/options.rb
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,9 @@ def add_preference(name, value)
#

def headless!
WebDriver.logger.deprecate('`Options#headless!`',
"`options = Selenium::WebDriver::Options.chrome(args: ['--headless=chrome'])`",
id: :headless)
add_argument '--headless'
end

Expand Down
3 changes: 3 additions & 0 deletions rb/lib/selenium/webdriver/firefox/options.rb
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,9 @@ def add_preference(name, value)
#

def headless!
WebDriver.logger.deprecate('`Options#headless!`',
"`options = Selenium::WebDriver::Options.firefox(args: ['-headless'])`",
id: :headless)
add_argument '-headless'
end

Expand Down

0 comments on commit 1e9fd6d

Please sign in to comment.