-
Notifications
You must be signed in to change notification settings - Fork 40
feat: add pytest-ipywidgets bbox testing, remove playwright #999
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Add browser-based UI testing for Lonboard's bounding box workflow using pytest-ipywidgets. This provides faster, more focused testing compared to full E2E tests while maintaining comprehensive validation of bbox interactions and state synchronization. - Complete bbox workflow testing (button click → canvas drawing → coordinate validation) - Canvas-relative coordinates to avoid deck.gl API issues - Geographic coordinate validation matching Playwright spec - Consolidated single-file test structure with fixtures and validation - Integrates with existing pytest infrastructure and CI/CD
Remove Playwright and Vitest dependencies since pytest-ipywidgets provides better bbox testing coverage. Simplifies codebase and reduces maintenance overhead while maintaining comprehensive UI interaction testing. - Remove @playwright/test and vitest dependencies - Remove playwright.config.ts and vitest.config.ts - Remove tests/e2e/ directory and all Playwright tests - Remove E2E and vitest npm scripts - Update GitHub Actions workflow to focus on build and lint - Keep pytest-ipywidgets bbox testing in tests/ui/
- Add __init__.py to make tests/ui a proper package - Fix import ordering and formatting - Split complex assertions into separate lines - Replace single quotes with double quotes - Use @pytest.mark.usefixtures for proper fixture handling - Remove debug print statement All lint checks now pass with ruff.
Fixes failing CI tests in PR #999 where pytest-ipywidgets tests were failing due to missing playwright browsers.
- Remove trailing whitespace from test-js.yml - Fix end-of-file formatting - Format Python code in test_bbox_interaction.py
Remove useEffect that exposed window.__deck for Playwright e2e tests. Aligns with removing Playwright infrastructure in favor of pytest-ipywidgets.
Update typing-extensions from >=4.6.0 (conditional) to >=4.12.0 (unconditional) to resolve ParamSpec compatibility issue with Python 3.13. Removes python_version < '3.12' condition since pytest-ipywidgets dependencies require typing-extensions even on Python 3.12+. Resolves AttributeError where ParamSpec.__default__ attribute became read-only in Python 3.13.
|
@kylebarron this is ready for review. Your suggestion to use pytest-ipywidgets is great, it is much better suited for TDD. I bumped typing-extensions, I hope I didn't break anything unrelated. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for the slow review, thank you!
| useEffect(() => { | ||
| if (deckRef.current && typeof window !== "undefined") { | ||
| (window as unknown as Record<string, unknown>).__deck = | ||
| deckRef.current.deck; | ||
| } | ||
| }, [deckRef.current]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder whether it could make sense to keep this? It can be useful to access the deck object on the window when debugging
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I restored this for merging, but happy to continue discussion
Summary
Add pytest-ipywidgets for browser-based bbox interaction testing and remove Playwright/Vitest infrastructure.
Changes
tests/ui/test_bbox_interaction.pywith complete bbox workflow testingBenefits
Related Issues