From a051712dc8ae5ef159e56b30c233a14155c5da77 Mon Sep 17 00:00:00 2001 From: Jens <1742418+1cu@users.noreply.github.com> Date: Fri, 3 Jul 2026 14:48:00 +0200 Subject: [PATCH] fix: handle portal combobox attributes (#1195) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## â„šī¸ Description - Link to the related issue(s): Issue # - Fixes publishing for special-attribute button comboboxes whose option list opens via a fuller click sequence or renders outside the control parent element. ## 📋 Changes Summary - Dispatch mouseup and click in addition to the existing pointer/mouse down events when opening button comboboxes. - Add document-level listbox/menu fallback lookup for portal-rendered combobox popups. - Normalize option text whitespace before text fallback matching. - Add regression coverage for the combobox JS contract and no-options failure diagnostics. ### âš™ī¸ Type of Change - [x] 🐞 Bug fix (non-breaking change which fixes an issue) - [ ] ✨ New feature (adds new functionality without breaking existing usage) - [ ] đŸ’Ĩ Breaking change (changes that might break existing user setups, scripts, or configurations) ## ✅ Checklist - [x] I have reviewed my changes to ensure they meet the project standards. - [x] I have tested my changes and ensured that all tests pass (pdm run test). - [x] I have formatted the code (pdm run format). - [x] I have verified that linting passes (pdm run lint). - [x] I have updated documentation where necessary. ## Summary by CodeRabbit ## Summary by CodeRabbit * **Bug Fixes** * Improved dropdown/combobox selection reliability, including better support for portal-rendered menus and document-level listbox/menu fallbacks. * Made option matching more tolerant by normalizing whitespace and applying consistent case handling. * Reduced selection failures by using a more complete native interaction sequence when opening and choosing options. * Enhanced unit coverage to validate the injected selection script and clearer timeout error messaging. --- src/kleinanzeigen_bot/publishing_form.py | 46 ++++++++++++++--- tests/unit/test_publishing_form.py | 63 ++++++++++++++++++++++-- 2 files changed, 100 insertions(+), 9 deletions(-) diff --git a/src/kleinanzeigen_bot/publishing_form.py b/src/kleinanzeigen_bot/publishing_form.py index e0caa41..ef6a6b2 100644 --- a/src/kleinanzeigen_bot/publishing_form.py +++ b/src/kleinanzeigen_bot/publishing_form.py @@ -500,9 +500,13 @@ async def set_pricing_fields(web:WebScrapingMixin, ad_cfg:Ad, ad_defaults:AdDefa async def _select_button_combobox(web:WebScrapingMixin, elem_id:str, value:str) -> None: """Select an option from a