Skip to content

[rb] fix Ruby tests failing because of alerts in Firefox#17294

Merged
asolntsev merged 9 commits intoSeleniumHQ:trunkfrom
asolntsev:fix/failing-ruby-tests
Apr 3, 2026
Merged

[rb] fix Ruby tests failing because of alerts in Firefox#17294
asolntsev merged 9 commits intoSeleniumHQ:trunkfrom
asolntsev:fix/failing-ruby-tests

Conversation

@asolntsev
Copy link
Copy Markdown
Contributor

Seems that Firefox behavior with alerts was changed. Without "unhandledPromptBehavior" capability, command wait_for_alert is always failing in FireFox.

🔗 Related Issues

e.g. https://github.com/SeleniumHQ/selenium/actions/runs/23901428682/job/69699326193?pr=17287

💥 What does this PR do?

Adds capability "unhandled_prompt_behavior"="ignore" to firefox options.

🔄 Types of changes

  • Bug fix (backwards compatible)

Seems that Firefox behavior with alerts was changed. Without "unhandledPromptBehavior" capability, command `wait_for_alert` is always failing in FireFox.
@asolntsev asolntsev self-assigned this Apr 2, 2026
@asolntsev asolntsev added this to the 4.42.0 milestone Apr 2, 2026
@qodo-code-review
Copy link
Copy Markdown
Contributor

Review Summary by Qodo

Fix Ruby tests failing due to Firefox alert handling

🐞 Bug fix

Grey Divider

Walkthroughs

Description
• Adds unhandled_prompt_behavior capability to Firefox options
• Fixes wait_for_alert command failures in Firefox tests
• Sets unhandled_prompt_behavior to 'ignore' by default

Grey Divider

File Changes

1. rb/spec/integration/selenium/webdriver/spec_support/test_environment.rb 🐞 Bug fix +1/-0

Add unhandled_prompt_behavior capability to Firefox options

• Adds unhandled_prompt_behavior capability set to 'ignore' in Firefox options
• Resolves Firefox alert handling issues in wait_for_alert tests
• Maintains backwards compatibility with existing code

rb/spec/integration/selenium/webdriver/spec_support/test_environment.rb


Grey Divider

Qodo Logo

@qodo-code-review
Copy link
Copy Markdown
Contributor

qodo-code-review bot commented Apr 2, 2026

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)

Grey Divider

Great, no issues found!

Qodo reviewed your code and found no material issues that require review

Grey Divider

ⓘ The new review experience is currently in Beta. Learn more

Grey Divider

Qodo Logo

@selenium-ci selenium-ci added the C-rb Ruby Bindings label Apr 2, 2026
@asolntsev asolntsev added I-defect Something is not working as intended D-firefox ruby Pull requests that update ruby code and removed C-rb Ruby Bindings labels Apr 2, 2026
@asolntsev asolntsev requested a review from cgoldberg April 2, 2026 18:50
@cgoldberg
Copy link
Copy Markdown
Member

I pushed a fix to this branch to try to fix the symlink issue in Ruby tests. I have no idea why we just started seeing that

@asolntsev
Copy link
Copy Markdown
Contributor Author

@cgoldberg Seems that now all tests are passing, but the failure is something new: :( :(

(20:36:34) ERROR: Skipping '//dotnet/test/common:NetworkInterceptionTests-chrome': no such package 'dotnet/test/common': BUILD file not found in any of the following directories. Add a BUILD file to a directory to mark it as a package.
 - dotnet/test/common
(20:36:34) ERROR: Skipping '//dotnet/test/common:NetworkInterceptionTests-edge': no such package 'dotnet/test/common': BUILD file not found in any of the following directories. Add a BUILD file to a directory to mark it as a package.
 - dotnet/test/common
(20:36:34) ERROR: Skipping '//dotnet/test/firefox:FirefoxDriverTests-firefox': no such package 'dotnet/test/firefox': BUILD file not found in any of the following directories. Add a BUILD file to a directory to mark it as a package.


(20:39:44) ERROR: command succeeded, but there were errors parsing the target pattern
(20:39:44) INFO: Elapsed time: 219.920s, Critical Path: 35.79s
(20:39:44) INFO: 23663 processes: 9769 remote cache hit, 15859 internal, 1 remote.
(20:39:44) ERROR: Build did NOT complete successfully
(20:39:44) FAILED: 


Executed 0 out of 2927 tests: 2927 tests pass.
There were tests whose specified size is too big. Use the --test_verbose_timeout_warnings command line option to see which ones these are.
All tests passed but there were other errors during the build.

@cgoldberg
Copy link
Copy Markdown
Member

I think that #17281 caused that one. I just pinged @nvborisenko in Slack.

We're almost there :)

@cgoldberg
Copy link
Copy Markdown
Member

cgoldberg commented Apr 2, 2026

I reverted my attempt at fixing the symlink issue for ruby. rules_ruby is creating a recursive symlink that is causing it to fail... but I don't know how to fix it or why it's happening. It's only happening on Windows

@asolntsev asolntsev enabled auto-merge (squash) April 3, 2026 06:07
@asolntsev asolntsev merged commit fa5b814 into SeleniumHQ:trunk Apr 3, 2026
5 of 7 checks passed
@asolntsev asolntsev deleted the fix/failing-ruby-tests branch April 3, 2026 06:08
AutomatedTester pushed a commit that referenced this pull request Apr 7, 2026
* fix Ruby tests failing because of alerts in Firefox

Seems that Firefox behavior with alerts was changed. Without "unhandledPromptBehavior" capability, command `wait_for_alert` is always failing in FireFox.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

D-firefox I-defect Something is not working as intended ruby Pull requests that update ruby code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants