Skip to content

Feat dec fixes#1765

Merged
robbrad merged 3 commits into
masterfrom
feat_dec_fixes
Dec 8, 2025
Merged

Feat dec fixes#1765
robbrad merged 3 commits into
masterfrom
feat_dec_fixes

Conversation

@robbrad
Copy link
Copy Markdown
Owner

@robbrad robbrad commented Dec 8, 2025

Summary by CodeRabbit

Release Notes

Bug Fixes

  • Improved cookie banner handling for more reliable access to council websites
  • Enhanced address search and dropdown selection workflow to streamline property lookups
  • Fixed date comparison logic for accurate historical bin collection record tracking

✏️ Tip: You can customize this high-level summary in your review settings.

@robbrad robbrad merged commit 291eccc into master Dec 8, 2025
7 of 9 checks passed
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Dec 8, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

This PR refactors webdriver initialization, updates element locators across multiple council scrapers to use CSS selectors and XPath, adjusts date comparison logic for bin date calculations, and improves dropdown interaction handling in address inputs.

Changes

Cohort / File(s) Summary
Webdriver initialization refactoring
uk_bin_collection/uk_bin_collection/common.py
Refactors create_webdriver to assign both remote and local driver instances to a local variable, enforce window positioning at (0, 0), and use a single return point instead of multiple early returns.
Element locator updates
uk_bin_collection/uk_bin_collection/councils/Hillingdon.py
Changes cookie banner element selection from By.CLASS_NAME to By.CSS_SELECTOR for more reliable targeting.
Address input and dropdown interaction refinements
uk_bin_collection/uk_bin_collection/councils/WestOxfordshireDistrictCouncil.py
Adds pre-scroll on page load, replaces address input locator with clickable XPath, introduces BACKSPACE + character keystroke to trigger dropdown, adds explicit wait for dropdown items, and updates dropdown item selection to target the second combobox item with clarifying comments.
Date comparison logic
uk_bin_collection/uk_bin_collection/councils/AdurAndWorthingCouncils.py
Replaces time-based date arithmetic with date-only comparison; converts both today and bin_date to .date() objects to check if bin date is more than 30 days in the past.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • WestOxfordshireDistrictCouncil.py requires validation of the new XPath locators and dropdown interaction logic, particularly the keystroke sequence and wait conditions
  • Hillingdon.py locator change should be tested to ensure CSS selector reliably captures the cookie banner button
  • AdurAndWorthingCouncils.py date logic change warrants verification of edge cases around the 30-day threshold
  • common.py refactoring is straightforward but should confirm window positioning behavior across both remote and local drivers

Possibly related PRs

Suggested reviewers

  • dp247

Poem

🐰 A webdriver hops and finds its place,
Windows positioned, single return to embrace,
Dropdowns now dance with XPath so fine,
Date checks made simple, no time to decline,
Locators refined through the burrow we go! ✨

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat_dec_fixes

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between eddf903 and b6587fd.

📒 Files selected for processing (4)
  • uk_bin_collection/uk_bin_collection/common.py (1 hunks)
  • uk_bin_collection/uk_bin_collection/councils/AdurAndWorthingCouncils.py (1 hunks)
  • uk_bin_collection/uk_bin_collection/councils/Hillingdon.py (1 hunks)
  • uk_bin_collection/uk_bin_collection/councils/WestOxfordshireDistrictCouncil.py (1 hunks)

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@codecov
Copy link
Copy Markdown

codecov Bot commented Dec 8, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.81%. Comparing base (5849bac) to head (b6587fd).
⚠️ Report is 13 commits behind head on master.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1765      +/-   ##
==========================================
+ Coverage   86.79%   86.81%   +0.02%     
==========================================
  Files           9        9              
  Lines        1136     1138       +2     
==========================================
+ Hits          986      988       +2     
  Misses        150      150              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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.

1 participant