Skip to content

Commit

Permalink
Guard some specs
Browse files Browse the repository at this point in the history
  • Loading branch information
p0deje committed Jun 22, 2024
1 parent 0f49baa commit abe368d
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 12 deletions.
4 changes: 3 additions & 1 deletion rb/spec/integration/selenium/webdriver/driver_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@
module Selenium
module WebDriver
describe Driver, exclusive: {bidi: false, reason: 'Not yet implemented with BiDi'} do
it_behaves_like 'driver that can be started concurrently', exclude: {browser: %i[safari safari_preview]}
it_behaves_like 'driver that can be started concurrently',
exclude: {browser: %i[safari safari_preview]},
except: {driver: 'remote', rbe: true, reason: 'Cannot start 2+ drivers at once.'}

it 'creates default capabilities', exclude: {browser: %i[safari safari_preview]} do
reset_driver! do |driver|
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ module Firefox
end
end

it 'is able to use the same profile more than once' do
it 'is able to use the same profile more than once',
except: {driver: 'remote', rbe: true, reason: 'Cannot start 2+ drivers at once.'} do
reset_driver!(profile: profile) do |driver1|
expect { wait(5).until { driver1.find_element(id: 'oneline') } }.not_to raise_error
reset_driver!(profile: profile) do |driver2|
Expand Down
1 change: 1 addition & 0 deletions rb/spec/integration/selenium/webdriver/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
guards.add_condition(:platform, WebDriver::Platform.os)
guards.add_condition(:headless, !ENV['HEADLESS'].nil?)
guards.add_condition(:bidi, !ENV['WEBDRIVER_BIDI'].nil?)
guards.add_condition(:rbe, Dir.pwd.start_with?('/mnt/engflow'))

results = guards.disposition
send(*results) if results
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
create_driver!
end

fit 'starts multiple drivers sequentially', guard do
it 'starts multiple drivers sequentially', guard do
expected_count = WebDriver::Platform.ci ? 2 : 4
expected_count.times do
thread = Thread.new do
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,15 +88,15 @@ def app_server
end

def remote_server
if ENV.key?('CHROMEDRIVER_BINARY')
args = ["-Dwebdriver.chrome.driver=#{ENV['CHROMEDRIVER_BINARY']}"]
elsif ENV.key?('MSEDGEDRIVER_BINARY')
args = ["-Dwebdriver.edge.driver=#{ENV['MSEDGEDRIVER_BINARY']}"]
elsif ENV.key?('GECKODRIVER_BINARY')
args = ["-Dwebdriver.gecko.driver=#{ENV['GECKODRIVER_BINARY']}"]
else
args = %w[--selenium-manager true --enable-managed-downloads true]
end
args = if ENV.key?('CHROMEDRIVER_BINARY')
["-Dwebdriver.chrome.driver=#{ENV['CHROMEDRIVER_BINARY']}"]
elsif ENV.key?('MSEDGEDRIVER_BINARY')
["-Dwebdriver.edge.driver=#{ENV['MSEDGEDRIVER_BINARY']}"]
elsif ENV.key?('GECKODRIVER_BINARY')
["-Dwebdriver.gecko.driver=#{ENV['GECKODRIVER_BINARY']}"]
else
%w[--selenium-manager true --enable-managed-downloads true]
end

@remote_server ||= Selenium::Server.new(
remote_server_jar,
Expand Down

0 comments on commit abe368d

Please sign in to comment.