Skip to content

Add BiDi network examples and documentation for Ruby #2100

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: trunk
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/ruby/spec/actions_api/keys_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
let(:driver) { start_session }
let(:wait) { Selenium::WebDriver::Wait.new(timeout: 2) }

it 'key down' do
it 'key down', except: {platforn: :linux, reason: 'it only fails on the linux pipeline'} do
driver.get 'https://www.selenium.dev/selenium/web/single_text_input.html'
wait.until { driver.find_element(id: 'textInput').attribute('autofocus') }

Expand Down
2 changes: 1 addition & 1 deletion examples/ruby/spec/actions_api/mouse_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@
expect(y_coord).to be_within(1).of(center_y + 11)
end

it 'offset from viewport' do
it 'offset from viewport', {platforn: :linux, reason: 'it only fails on the linux pipeline'} do
driver.get 'https://www.selenium.dev/selenium/web/mouse_interaction.html'

driver.action
Expand Down
3 changes: 2 additions & 1 deletion examples/ruby/spec/bidi/logging_spec.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
require 'spec_helper'

RSpec.describe 'Logging' do
RSpec.describe 'Logging', exclusive: {bidi: true, reason: 'only executed when bidi is enabled'},
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are the guards registered in this test suite:
https://github.com/SeleniumHQ/seleniumhq.github.io/blob/trunk/examples/ruby/spec/spec_helper.rb#L19-L22

Either way, we're explicitly starting a bidi session below, so it won't ever run without being enabled.

Finally, guards don't work on the describe block, unfortunately, anyway

only: {browser: %i[chrome edge firefox]} do
let(:driver) { start_bidi_session }
let(:wait) { Selenium::WebDriver::Wait.new(timeout: 2) }

Expand Down
3 changes: 2 additions & 1 deletion examples/ruby/spec/bidi/network_spec.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
require 'spec_helper'

RSpec.describe 'Network' do
RSpec.describe 'Network', exclusive: {bidi: true, reason: 'only executed when bidi is enabled'},
only: {browser: %i[chrome edge firefox]} do
let(:driver) { start_bidi_session }
let(:wait) { Selenium::WebDriver::Wait.new(timeout: 2) }

Expand Down
3 changes: 2 additions & 1 deletion examples/ruby/spec/drivers/remote_webdriver_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
require 'spec_helper'
require 'selenium/server'

RSpec.describe 'Remote WebDriver' do
RSpec.describe 'Remote WebDriver', except: {platform: :macosx,
reason: 'it only fail due to the server in the mac pipeline'} do
let(:target_directory) { File.join(Dir.tmpdir, SecureRandom.uuid) }
let(:wait) { Selenium::WebDriver::Wait.new(timeout: 2) }
let(:server) do
Expand Down
Loading