Commit Graph

80 Commits

Author SHA1 Message Date
Heavenfighter
a5603e742f #545 refactored select city from zip (#546) 2025-06-10 14:47:02 +02:00
Jens Bergmann
92ac17b430 fix: improve login flow tests
Login Flow Tests:
- Fixed test_login_flow_handles_captcha to properly handle both login
attempts
- Added individual test functions for each component of the login flow:
  * test_check_and_wait_for_captcha: Tests captcha detection and user
interaction
  * test_fill_login_data_and_send: Tests login form filling and
submission
  * test_handle_after_login_logic: Tests post-login handling (device
verification, GDPR)
- Improved test assertions to match actual behavior of the login process
- Added proper async mocking to prevent test stalling

Test Init:
- Fixed test_extract_pricing_info to properly handle all price formats
- Improved test coverage for price extraction edge cases
- Ensured tests accurately reflect the actual behavior of the price
extraction logic
2025-06-09 21:39:56 +02:00
Heavenfighter
8ac57932ba fix: login does not work anymore #539
Refactored login input element ids.
Refactored captcha handling to one function
2025-06-09 21:39:56 +02:00
sebthom
ebfdbc4313 fix: shipping options are not applied when shipping_costs set to 0 #541 2025-06-09 20:58:04 +02:00
Heavenfighter
192b42a833 #525 Refactored gdpr handling (#532) 2025-05-28 14:43:23 +02:00
Heavenfighter
fbaeb80585 fix: clearing password input while logging in (#531)
* #530 Sending empty string to password input

* #530 added comment for clarification
2025-05-28 11:40:34 +02:00
Heavenfighter
e94a1dd8af fixes #522 (#523)
Refactored XPATH expression for
deselecting unwanted
shipping options.
2025-05-25 16:21:09 +02:00
sebthom
85a5cf5224 feat: improve content_hash calculation 2025-05-15 12:07:49 +02:00
sebthom
6ede14596d feat: add type safe Ad model 2025-05-15 12:07:49 +02:00
sebthom
1369da1c34 feat: add type safe Config model 2025-05-15 12:07:49 +02:00
Heavenfighter
0faa022e4d fix: Unable to download single ad (#509) 2025-05-14 11:24:16 +02:00
sebthom
8e2385c078 fix: TimeoutError: Unable to close shipping dialog! #505 2025-05-13 21:06:42 +02:00
sebthom
a03b368ccd fix: active: false in ad config is ignored #502 2025-05-13 20:59:15 +02:00
sebthom
58f6ae960f refact: simplify XPATH expressions 2025-05-12 18:28:28 +02:00
sebthom
ee4146f57c fix: auto-restart when captcha was encountered 2025-05-12 17:20:51 +02:00
DreckSoft
ed83052fa4 fix: Unable to close shipping dialog (#501)
Co-authored-by: Sebastian Thomschke <sebthom@users.noreply.github.com>
2025-05-11 20:29:10 +02:00
Benedikt
8b2d61b1d4 fix: improve login detection with fallback element (#493)
- Add fallback check for user-email element when mr-medium is not found
- Improve login detection reliability
- Add test case for alternative login element
2025-04-30 17:50:58 +02:00
sebthom
bda0acf943 refact: enable ruff preview rules 2025-04-28 13:17:23 +02:00
sebthom
f98251ade3 fix: improve ad description length validation 2025-04-28 13:17:23 +02:00
sebthom
ef923a8337 refact: apply consistent formatting 2025-04-28 12:55:28 +02:00
sebthom
376ec76226 refact: use ruff instead of autopep8,bandit,pylint for linting 2025-04-28 12:51:51 +02:00
sebthom
52e1682dba fix: avoid "[PYI-28040:ERROR]" log message when run via pyinstaller 2025-04-27 14:34:56 +02:00
DreckSoft
23929a62cc fix: logon detection and duplicate suffix in ad description (#488)
Co-authored-by: Sebastian Thomschke <sebthom@users.noreply.github.com>
2025-04-27 14:21:40 +02:00
Airwave1981
d87ae6e740 feat: allow auto-restart on captcha (#481)
Co-authored-by: sebthom <sebthom@users.noreply.github.com>
2025-04-26 14:40:47 +02:00
marvinkcode
79af6ba861 fix: Correct pagination selectors and logic for issue #477 (#479) 2025-04-21 20:26:02 +02:00
Heavenfighter
c144801d2e fixes #474
Now using ID to identify checkbox for custom shipping
2025-04-21 20:24:23 +02:00
Heavenfighter
33f58811cd Fixes setting shipping costs to zero.
Empty shipping costs lead to
default shipping.
2025-03-16 21:28:44 +01:00
Heavenfighter
57c89a6f64 Adding condition "Defekt" (#461) 2025-03-15 18:25:26 +01:00
Heavenfighter
9183909188 fix: setting shipping options properly (#457) 2025-03-14 12:34:39 +01:00
Heavenfighter
7742196043 fix: set custom shipping due css update #448 (#450) 2025-03-13 12:13:23 +01:00
Jens Bergmann
772326003f fix: Separate 'changed' and 'due' ad selectors (#442)
This commit implements a new 'changed' selector for the --ads option that
publishes only ads that have been modified since their last publication.
The 'due' selector now only republishes ads based on the time interval,
without considering content changes.

The implementation allows combining selectors with commas (e.g., --ads=changed,due)
to publish both changed and due ads. Documentation and translations have been
updated accordingly.

Fixes #411
2025-02-28 14:53:53 -05:00
NME
7b9412677e fix: Update css class selectors fixing #440 (#441)
* fixes #440 css update
* fixed class selector
* added missing translation
---------

Co-authored-by: Jens Bergmann <1742418+1cu@users.noreply.github.com>
2025-02-28 11:16:49 -05:00
Jens Bergmann
c7f7b832b2 fix: Make description field optional in ad_defaults
The description field in the main configuration (ad_defaults) is now optional.
Previously, the bot would fail if no description or affixes were provided in
the main configuration. This change addresses issue #435.

Changes:
- Add fallback to empty string ("") when all description prefix/suffix sources
  are None in __get_description_with_affixes method
- Add comprehensive test suite for description handling in test_init.py
- Fix coverage path in pyproject.toml from 'kleinanzeigen_bot' to
  'src/kleinanzeigen_bot'

New tests cover:
- Description handling without main config description
- New format affixes in configuration
- Mixed old/new format affixes
- Ad-level affix precedence
- None value handling in affixes
- Email address @ symbol replacement

This change maintains backward compatibility while making the description
field optional in the main configuration, improving flexibility for users.
2025-02-18 21:39:53 +01:00
Jens Bergmann
610615367c fix: consolidate description text processing (#432)
Consolidate description text processing into __get_description_with_affixes method:
- Move @ -> (at) replacement into the method
- Remove duplicate prefix/suffix handling code
- Ensure consistent description text processing in one place

This fixes #432 by ensuring consistent handling of description affixes
and text transformations.
2025-02-15 19:58:09 +01:00
Heavenfighter
543d46631c fix: Setting shipping options fails for commercial accounts. Fixes #394 (#424)
Co-authored-by: Jens Bergmann <1742418+1cu@users.noreply.github.com>
2025-02-13 17:13:32 +01:00
Jens Bergmann
4051620aed enh: allow per-ad overriding of global description affixes (#416) 2025-02-11 23:39:26 +01:00
Heavenfighter
a67112d936 fix: handle delayed ad publication #414 (#422) 2025-02-11 20:43:33 +01:00
sebthom
367ef07798 refact: improve logger handling 2025-02-10 20:34:58 +01:00
sebthom
2402ba2572 refact: reorganize utility modules 2025-02-10 06:23:17 +01:00
sebthom
7169975d2a fix: logging file handler not closed on bot shutdown. Fixes #405 2025-02-09 04:23:24 +01:00
Jens Bergmann
dd5f2ba5e4 fix: Ensure Consistent Content Hash Calculation (#415)
This commit addresses an issue where the content hash was being calculated on the current configuration (`ad_cfg`) instead of the original configuration (`ad_cfg_orig`). This could lead to inconsistent hash values, especially when the configuration is updated during the execution of the program.

The fix involves calculating the content hash on the original configuration (`ad_cfg_orig`) in both the `__check_ad_republication` and `publish_ad` methods. This ensures that the hash value is consistent and matches what was stored.

The relevant code changes are as follows:

- In the `__check_ad_republication` method, the content hash is now calculated on `ad_cfg_orig` instead of `ad_cfg`.
- In the `publish_ad` method, the content hash is also calculated on `ad_cfg_orig` to ensure consistency.

These changes should improve the reliability of the content hash comparison and the overall stability of the application.
2025-02-09 03:14:19 +01:00
DreckSoft
b12118361d feat: display actual num of chars of description when too long (#403) 2025-02-08 04:03:54 +01:00
1cu
f01109c956 feat: add hash-based ad change detection (#343) (#388)
Co-authored-by: sebthom <sebthom@users.noreply.github.com>
2025-01-26 23:37:33 +01:00
Heavenfighter
66634ce636 fix: fixed shipping button selector #385 (#387) 2025-01-20 21:40:28 +01:00
Jens Bergmann
2f93e0dfda fix: correct city selection when multiple cities are available for a ZIP code
When multiple cities are available for a ZIP code, the bot now correctly selects
the city specified in the YAML file's location field instead of always choosing
the first option.

The change:
- Adds logic to select the correct city from dropdown based on location field
- Adds a small delay after ZIP code input to allow dropdown to populate
- Uses proper WebScrapingMixin method to read dropdown options
2025-01-20 12:22:16 +01:00
sebthom
677c48628d fix: remove temporary workaround for #368 2025-01-10 16:21:44 +01:00
Heavenfighter
ca876e628b fix shipping options when downloading. Fixes #375 (#376) 2025-01-10 16:05:11 +01:00
Heavenfighter
33a43e3ff6 fix: setting shipping options regression #367 (#374)
Button with given label occurs too often. Path must be corrected.
2025-01-09 20:30:24 +01:00
Heavenfighter
f9eb6185c7 fix: failed to set special attributes #334 (#370) 2025-01-09 17:01:48 +01:00
Heavenfighter
e590a32aa2 fix: re-publishing without images #371 (#372)
added detection of image-question
2025-01-09 17:00:51 +01:00