aminghadersohi opened a new pull request, #35504:
URL: https://github.com/apache/superset/pull/35504

   ### SUMMARY
   
   This PR fixes a critical bug in the Selenium WebDriver initialization where 
the `options` object was being configured but never actually passed to the 
WebDriver constructor.
   
   **The Bug:**
   In `superset/utils/webdriver.py`, the code was:
   1. Creating an options object
   2. Setting capabilities on it (`options.set_capability()`)
   3. Setting preferences on it (`options.profile.set_preference()`)
   4. But then **not passing it to the WebDriver**
   
   This caused all custom WebDriver configurations (capabilities, preferences, 
browser settings) to be silently ignored, resulting in WebDriver instances 
running with default settings instead of the configured ones.
   
   **The Fix:**
   Added `"options": options,` to the kwargs dictionary that gets passed to the 
WebDriver initialization, ensuring the configured options are actually used.
   
   This is a one-line fix that restores proper WebDriver configuration 
functionality.
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   Not applicable - this is an internal bug fix with no UI changes.
   
   ### TESTING INSTRUCTIONS
   
   1. **Verify WebDriver options are respected:**
      ```bash
      # Set custom WebDriver configuration in superset_config.py
      WEBDRIVER_TYPE = "firefox"
      WEBDRIVER_CONFIGURATION = {
          "options": {
              "capabilities": {
                  "acceptInsecureCerts": True
              },
              "preferences": {
                  "browser.download.folderList": 2
              }
          }
      }
      ```
   
   2. **Test screenshot/thumbnail generation:**
      - Navigate to a dashboard
      - Generate a thumbnail or screenshot
      - Verify the WebDriver uses the configured options (check browser 
logs/behavior)
   
   3. **Verify no regression:**
      ```bash
      # Run WebDriver-related tests
      pytest tests/integration_tests/reports/
      pytest tests/integration_tests/thumbnails/
      ```
   
   ### ADDITIONAL INFORMATION
   
   - [ ] Has associated issue:
   - [ ] Required feature flags:
   - [ ] Changes UI
   - [ ] Includes DB Migration (follow approval process in 
[SIP-59](https://github.com/apache/superset/issues/13351))
     - [ ] Migration is atomic, supports rollback & is backwards-compatible
     - [ ] Confirm DB migration upgrade and downgrade tested
     - [ ] Runtime estimates and downtime expectations provided
   - [ ] Introduces new feature or API
   - [ ] Removes existing feature or API
   
   **Notes:**
   - This is a bug fix with no breaking changes
   - Affects all Selenium WebDriver usage (screenshots, thumbnails, reports)
   - The bug likely went unnoticed because default WebDriver settings work in 
most cases
   - No database migration or feature flags required


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to