-
-
Notifications
You must be signed in to change notification settings - Fork 8.7k
[rb] Fix failing firefox beta tests for browser context #17199
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
base: trunk
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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
|
||
| 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 | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.