summaryrefslogtreecommitdiff
path: root/app/src/debug/res/xml/network_security_config.xml
AgeCommit message (Collapse)Author
2026-08-24Add instrumented extraction fixture tests for WHT/Ars TechnicaPeter Stone
BACKLOG's "Extraction test coverage for WHT / Ars Technica" item: ReaderExtractor's site-specific preprocessing had only ever been diagnosed by hand against single live articles across several rounds of fixes. Four hand-authored fixtures now pin down the exact behavior: - West Hawaii Today's paywall-div unhide (class="paywall paywall_*") - Lazy-loaded image src resolution (data-src -> src) - Ars Technica's duplicate PhotoSwipe caption removal (.pswp-caption-content vs. the real <figcaption>) - Ars's split .post-content.post-content-double block merge Needs a real WebView to run Readability.js, so these are instrumented tests (app/src/androidTest/), not plain JVM unit tests -- that source set didn't exist yet (testInstrumentationRunner + androidx.test deps added to app/build.gradle.kts). Fixtures are minimal hand-authored markup targeting the exact selectors ReaderExtractor's own code uses, not scraped live pages, which rot and would fail for reasons unrelated to the extraction logic. Fixtures are served over real http:// via MockWebServer, since ReaderExtractor's WebView has allowFileAccess = false and won't load file:// URLs. Added a debug-only network security config override (app/src/debug/res/xml/network_security_config.xml) permitting cleartext to 127.0.0.1/localhost for this -- release is untouched. Verified the tests actually catch regressions, not just pass trivially: temporarily broke the paywall-unhide selector, confirmed the corresponding test failed on both connected emulators, then reverted and confirmed green again. Ran on 2 connected devices (feedreader_test, doot_test_api36): 4/4 passing, 0 failures. Instrumented tests aren't counted by the JVM-only jacoco coverage metric (expected, not a gate miss -- see CLAUDE.md). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017GMEkHeqKz6FLkmizowBTK