Skip to content

Commit 2b2c2ce

Browse files
committed
[rb] allow all drivers to access information from status endpoint and deprecate #remote_status
1 parent 379e67f commit 2b2c2ce

File tree

3 files changed

+16
-0
lines changed

3 files changed

+16
-0
lines changed

rb/lib/selenium/webdriver/common/driver.rb

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,16 @@ def inspect
7878
format '#<%<class>s:0x%<hash>x browser=%<browser>s>', class: self.class, hash: hash * 2, browser: bridge.browser.inspect
7979
end
8080

81+
#
82+
# information about whether a remote end is in a state in which it can create new sessions,
83+
# and may include additional meta information.
84+
#
85+
# @return [Hash]
86+
#
87+
def status
88+
@bridge.status
89+
end
90+
8191
#
8292
# @return [Navigation]
8393
# @see Navigation

rb/lib/selenium/webdriver/common/driver_extensions/has_remote_status.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ module WebDriver
2222
module DriverExtensions
2323
module HasRemoteStatus
2424
def remote_status
25+
WebDriver.logger.deprecate('#remote_status', '#status')
2526
@bridge.status
2627
end
2728
end # HasRemoteStatus

rb/spec/integration/selenium/webdriver/driver_spec.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,11 @@ module WebDriver
3939
end
4040
end
4141

42+
it 'should get driver status' do
43+
status = driver.status
44+
expect(status).to include('ready', 'message')
45+
end
46+
4247
it 'should get the page title' do
4348
driver.navigate.to url_for('xhtmlTest.html')
4449
expect(driver.title).to eq('XHTML Test Page')

0 commit comments

Comments
 (0)