Skip to content
Open
Changes from all commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -81,47 +81,57 @@ class BiDi
expect(driver.execute_script('return window.devicePixelRatio')).to eq(2.0)
end

it 'accepts users prompts without text',
except: {browser: %i[edge chrome],
reason: 'https://github.com/GoogleChromeLabs/chromium-bidi/issues/3281'} do
browsing_context = described_class.new(bridge)
context 'with user prompts' do
before do
reset_driver!(unhandled_prompt_behavior: :ignore)
end

driver.navigate.to url_for('alerts.html')
driver.find_element(id: 'alert').click
wait_for_alert
window = driver.window_handles.first
browsing_context.handle_user_prompt(window, accept: true)
wait_for_no_alert
it 'accepts user prompts without text' do
browsing_context = described_class.new(bridge)

Comment on lines +89 to 91
Copy link

Copilot AI Mar 11, 2026

Choose a reason for hiding this comment

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

These user-prompt examples previously had an except for Chrome/Edge (linked to chromium-bidi issue #3281). This PR removes that exclusion, so the specs will now run on Chrome/Edge (the outer only includes them) and may reintroduce known failures. If the upstream issue is still relevant, please restore the except metadata (or update it with the correct reason/issue if it’s been resolved).

Copilot uses AI. Check for mistakes.
expect(driver.title).to eq('Testing Alerts')
end
driver.navigate.to url_for('alerts.html')
window = driver.window_handle
prompt_opened = Queue.new
bridge.bidi.session.subscribe('browsingContext.userPromptOpened')
bridge.bidi.add_callback('browsingContext.userPromptOpened') { prompt_opened.push(true) }
driver.find_element(id: 'alert').click
wait.until { !prompt_opened.empty? }
browsing_context.handle_user_prompt(window, accept: true)
wait_for_no_alert

it 'accepts users prompts with text',
except: {browser: %i[edge chrome],
reason: 'https://github.com/GoogleChromeLabs/chromium-bidi/issues/3281'} do
browsing_context = described_class.new(bridge)
driver.navigate.to url_for('alerts.html')
driver.find_element(id: 'prompt').click
wait_for_alert
window = driver.window_handles.first
browsing_context.handle_user_prompt(window, accept: true, text: 'Hello, world!')
wait_for_no_alert

expect(driver.title).to eq('Testing Alerts')
end
expect(driver.title).to eq('Testing Alerts')
end

it 'rejects users prompts', except: {browser: %i[edge chrome],
reason: 'https://github.com/GoogleChromeLabs/chromium-bidi/issues/3281'} do
browsing_context = described_class.new(bridge)
driver.navigate.to url_for('alerts.html')
driver.find_element(id: 'alert').click
wait_for_alert
window = driver.window_handles.first
it 'accepts user prompts with text' do
browsing_context = described_class.new(bridge)
driver.navigate.to url_for('alerts.html')
window = driver.window_handle
prompt_opened = Queue.new
bridge.bidi.session.subscribe('browsingContext.userPromptOpened')
bridge.bidi.add_callback('browsingContext.userPromptOpened') { prompt_opened.push(true) }
driver.find_element(id: 'prompt').click
wait.until { !prompt_opened.empty? }
browsing_context.handle_user_prompt(window, accept: true, text: 'Hello, world!')
wait_for_no_alert

expect(driver.title).to eq('Testing Alerts')
end

browsing_context.handle_user_prompt(window, accept: false)
wait_for_no_alert
it 'rejects user prompts' do
browsing_context = described_class.new(bridge)
driver.navigate.to url_for('alerts.html')
window = driver.window_handle
prompt_opened = Queue.new
bridge.bidi.session.subscribe('browsingContext.userPromptOpened')
bridge.bidi.add_callback('browsingContext.userPromptOpened') { prompt_opened.push(true) }
driver.find_element(id: 'alert').click
wait.until { !prompt_opened.empty? }

expect(driver.title).to eq('Testing Alerts')
browsing_context.handle_user_prompt(window, accept: false)
wait_for_no_alert

expect(driver.title).to eq('Testing Alerts')
end
end

it 'activates a browser context' do
Expand Down
Loading