Skip to content

Commit

Permalink
rb: get HasNetworkConnection (and specs) to work
Browse files Browse the repository at this point in the history
Signed-off-by: Andreas Tolfsen <ato@mozilla.com>
  • Loading branch information
jimvm authored and andreastt committed Mar 2, 2015
1 parent 29ea618 commit 51d4486
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 3 additions & 1 deletion rb/lib/selenium/webdriver/remote/bridge.rb
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@ def driver_extensions
DriverExtensions::HasSessionId,
DriverExtensions::Rotatable,
DriverExtensions::HasTouchScreen,
DriverExtensions::HasLocation,
DriverExtensions::HasNetworkConnection,
DriverExtensions::HasRemoteStatus
]
end
Expand Down Expand Up @@ -326,7 +328,7 @@ def getNetworkConnection
end

def setNetworkConnection(type)
execute :setNetworkConnection, {}, :type => type
execute :setNetworkConnection, {}, :parameters => {:type => type}
end

#
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,13 @@

module Selenium::WebDriver::DriverExtensions
describe HasNetworkConnection do
compliant_on :browser => nil do
compliant_on :browser => :android do
it "can return the network connection type" do
expect(driver.network_connection_type).to eq :all
end

it "can set the network connection type" do
expect { driver.network_connection_type = :airplane_mode }.to
change { driver.network_connection_type }.from(:all).to(:airplane_mode)
expect { driver.network_connection_type = :airplane_mode }.to change { driver.network_connection_type }.from(:all).to(:airplane_mode)
end
end
end
Expand Down

0 comments on commit 51d4486

Please sign in to comment.