[MOB-38657] Functional + BPT: Assert Dialog and Answer Dialog actions do not work - #1984
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Updates the Selenium JS dialog interception helpers used by Taurus-generated Selenium tests to make alert()/confirm() non-blocking and better support “assert dialog” / “answer dialog” actions.
Changes:
- Simplified the overridden
window.alert()implementation to always capture messages without delegating to the native alert. - Changed overridden
window.confirm()to default totruewhen no explicit next-answer is set.
Comments suppressed due to low confidence (1)
bzt/resources/selenium_extras.py:246
dialogs_replace()initializeswindow.__webdriverNextPrompts(plural), but the prompt override reads/writeswindow.__webdriverNextPrompt(singular). As a result, on the firstwindow.prompt()call__webdriverNextPromptmay beundefined, so the overridden prompt returnsundefinedinstead of a string ornull, anddialogs_answer_on_next_prompt()may behave inconsistently. Align the variable name (and consider initializing__webdriverNextPromptto a sensible default).
window.__webdriverPrompts = [];
window.__webdriverNextPrompts = true;
window.prompt = function(msg, def) {
window.__webdriverPrompts.push(msg || def);
var res = window.__webdriverNextPrompt;
window.__webdriverNextPrompt = true;
return res;
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
pjain05
approved these changes
May 8, 2026
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1984 +/- ##
=======================================
Coverage 89.90% 89.90%
=======================================
Files 71 71
Lines 20232 20232
=======================================
Hits 18187 18187
Misses 2045 2045 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
mykhaliev1
approved these changes
May 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.