Skip to content

Conversation

@vgeorge
Copy link
Member

@vgeorge vgeorge commented Oct 29, 2025

Summary

Add pytest-ipywidgets for browser-based bbox interaction testing and remove Playwright/Vitest infrastructure.

Changes

  • Add tests/ui/test_bbox_interaction.py with complete bbox workflow testing
  • Add pytest-ipywidgets>=1.54.0 dependency
  • Remove all Playwright tests, configs, and dependencies
  • Remove Vitest testing infrastructure
  • Update GitHub Actions workflow to focus on build and lint

Benefits

  • Faster widget-level testing vs full E2E
  • Better debugging with console access
  • Simplified maintenance with single test file
  • Same bbox interaction validation maintained

Related Issues

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.
@github-actions github-actions bot added the feat label Oct 29, 2025
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.
@vgeorge vgeorge requested a review from kylebarron October 29, 2025 16:32
@vgeorge
Copy link
Member Author

vgeorge commented Oct 29, 2025

@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.

Copy link
Member

@kylebarron kylebarron left a 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!

Comment on lines 67 to 72
useEffect(() => {
if (deckRef.current && typeof window !== "undefined") {
(window as unknown as Record<string, unknown>).__deck =
deckRef.current.deck;
}
}, [deckRef.current]);
Copy link
Member

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

Copy link
Member

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

@kylebarron kylebarron merged commit 6899f08 into main Nov 3, 2025
6 checks passed
@kylebarron kylebarron deleted the feat/pytest-ipywidgets-testing branch November 3, 2025 19:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Automated widget testing

3 participants