Skip to content

[MOB-38657] Functional + BPT: Assert Dialog and Answer Dialog actions do not work - #1984

Merged
devership16 merged 2 commits into
masterfrom
MOB-38657_assertDialog
May 8, 2026
Merged

[MOB-38657] Functional + BPT: Assert Dialog and Answer Dialog actions do not work#1984
devership16 merged 2 commits into
masterfrom
MOB-38657_assertDialog

Conversation

@devership16

@devership16 devership16 commented May 7, 2026

Copy link
Copy Markdown
Collaborator

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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 to true when no explicit next-answer is set.
Comments suppressed due to low confidence (1)

bzt/resources/selenium_extras.py:246

  • dialogs_replace() initializes window.__webdriverNextPrompts (plural), but the prompt override reads/writes window.__webdriverNextPrompt (singular). As a result, on the first window.prompt() call __webdriverNextPrompt may be undefined, so the overridden prompt returns undefined instead of a string or null, and dialogs_answer_on_next_prompt() may behave inconsistently. Align the variable name (and consider initializing __webdriverNextPrompt to 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.

Comment thread bzt/resources/selenium_extras.py
@codecov

codecov Bot commented May 8, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.90%. Comparing base (634e77c) to head (7ad8ccf).

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@devership16
devership16 merged commit fd2ac2e into master May 8, 2026
3 checks passed
@devership16
devership16 deleted the MOB-38657_assertDialog branch May 8, 2026 10:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants