Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
4dee69a
Add some notes the AI made about how to interact with the HA via play…
TrentHouliston Dec 19, 2025
cc086e2
Add MCP instructions, and update the sigenergy example based on runni…
TrentHouliston Dec 19, 2025
bc0a8be
Incredibly impressed, good job
TrentHouliston Dec 19, 2025
8df5fd4
Don't need this anymore
TrentHouliston Dec 19, 2025
e2a6416
.
TrentHouliston Dec 19, 2025
777d249
Show all clicks and scrolls
TrentHouliston Dec 19, 2025
d37ee98
the html capture is working!
TrentHouliston Dec 20, 2025
16ad648
.
TrentHouliston Dec 20, 2025
a2ee930
Generates things!
TrentHouliston Dec 20, 2025
a6f7825
Preprocessing steps for weird cases
TrentHouliston Dec 20, 2025
b33a3c4
.
TrentHouliston Dec 20, 2025
b1a5a8d
refactor: Remove HTML snapshot capture, keep PNG only
TrentHouliston Jan 12, 2026
e552553
Merge origin/main into browser-automation
TrentHouliston Jan 12, 2026
423073d
fix: Update guide for current config flows and add dark mode
TrentHouliston Jan 12, 2026
2f847ce
fix: Improve screenshot highlighting and capture completeness
TrentHouliston Jan 12, 2026
6fa15de
feat(guides): use overlay for click indicators to fix clipping issues
TrentHouliston Jan 12, 2026
4b06302
remove from package.json means remove from package-lock.json
TrentHouliston Jan 12, 2026
4bb4021
Simplify the PR a little
TrentHouliston Jan 12, 2026
fee2fe4
chore(guides): clean up debug files and fix linting
TrentHouliston Jan 12, 2026
c76dfb0
refactor(guides): clean up browser automation code
TrentHouliston Jan 12, 2026
3925f39
Formatting
TrentHouliston Jan 12, 2026
5be82e5
Add guide primitives package for browser automation
TrentHouliston Jan 12, 2026
165f21a
Refactor sigenergy guide to use primitives
TrentHouliston Jan 12, 2026
60bae74
Remove external JS file - code now inlined in ha_page.py
TrentHouliston Jan 12, 2026
75e1054
Simplify guide to use primitives with config data
TrentHouliston Jan 12, 2026
1227e48
Refactor screenshot capture with hierarchical naming
TrentHouliston Jan 12, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,11 @@ dependencies = ["homeassistant>=2025.12.2", "numpy>=2.3.2", "highspy>=1.12.0"]

[dependency-groups]
dev = [
"beautifulsoup4>=4.14.3",
"freezegun>=1.5.2",
"matplotlib>=3.10.8",
"networkx>=3.4.2",
"playwright>=1.57.0",
"mdformat-beautysh>=1.0.0",
"mdformat-config>=0.2.1",
"mdformat-footnote>=0.1.1",
Expand Down Expand Up @@ -134,6 +136,9 @@ addopts = ["--strict-markers", "--strict-config"]
filterwarnings = ["error"]
markers = [
"scenario: marks tests as scenario tests (select with '-m \"scenario\"')",
"browser: marks tests as browser automation tests (select with '-m \"browser\"')",
"guide: marks tests as guide screenshot tests (select with '-m \"guide\"')",
"enable_socket: marks tests that need real socket access",
]

[tool.coverage.run]
Expand Down
15 changes: 13 additions & 2 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,17 @@ def configure_logging() -> None:


@pytest.fixture(autouse=True)
def auto_enable_custom_integrations(enable_custom_integrations: None) -> bool:
"""Enable loading custom integrations in all tests."""
def auto_enable_custom_integrations(request: pytest.FixtureRequest) -> bool:
"""Enable loading custom integrations in all tests.

Skip for guide tests which use their own HA instance without
the pytest-homeassistant-custom-component fixtures.
"""
# Skip for guide tests - they don't use the hass fixture
if "guide" in (mark.name for mark in request.node.iter_markers()):
return True

# For non-guide tests, request the enable_custom_integrations fixture
# which depends on the hass fixture
enable_custom_integrations = request.getfixturevalue("enable_custom_integrations")
return enable_custom_integrations is None
5 changes: 5 additions & 0 deletions tests/guides/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Screenshot outputs (generated by guide tests)
*/screenshots*

# Log files
*.log
1 change: 1 addition & 0 deletions tests/guides/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"""Guide tests with browser automation and live Home Assistant."""
22 changes: 22 additions & 0 deletions tests/guides/conftest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
"""Configuration for guide tests.

Guide tests are designed to run Home Assistant in-process with browser
automation. They do NOT use pytest-homeassistant-custom-component fixtures
since they need a full HTTP server for Playwright.

These tests should be run with:
uv run python tests/guides/<test_file>.py

Or via pytest with explicit socket enabling:
uv run pytest tests/guides/ --force-enable-socket -m guide
"""

import pytest


def pytest_configure(config: pytest.Config) -> None:
"""Register guide marker."""
config.addinivalue_line(
"markers",
"guide: mark test as a guide test (runs full HA with HTTP, needs network)",
)
Loading
Loading