The pre-branch viewport-only wait_for_function ran regardless of which
screenshot path was taken. For tiled screenshots, per-tile checks in
take_tiled_screenshot already handle every viewport as we scroll, so
the pre-branch check is redundant there. For non-tiled screenshots,
element.screenshot() captures the full element including below-the-fold
content, so a global (all-spinners) check is correct.
Move the global querySelector('.loading').length === 0 check into each
non-tiled branch and remove it from the pre-branch position, so:
- non-tiled path: global check (waits for all charts including below fold)
- tiled path: no pre-check; per-tile viewport checks in screenshot_utils
handle spinner detection tile by tile
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Update assert_any_call in per-tile spinner timeout test to include the
new (load_wait=%ss) suffix and value
- Update assert_any_call in webdriver spinner timeout test to include the
new (SCREENSHOT_LOAD_WAIT=%ss) suffix and value
- Fix test_per_tile_non_timeout_exceptions: RuntimeError is caught by the
outer take_tiled_screenshot handler and returns None, not re-raised;
rename and update assertion to match actual behavior
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Replace global '.loading' count check in webdriver.py with a
getBoundingClientRect viewport-visibility check to avoid deadlock
when DashboardVirtualization renders off-screen placeholder spinners
- Narrow except clause in screenshot_utils.py from bare Exception to
PlaywrightTimeout so non-timeout errors (e.g. browser crash) propagate
- Fix load_wait default from 30 s to 60 s to match SCREENSHOT_LOAD_WAIT
config default
- Add tests covering per-tile spinner wait, timeout warning, non-timeout
propagation, and load_wait default value
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>