Draft
Conversation
Co-authored-by: gensyn <36128035+gensyn@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add Playwright end-to-end tests for Task Tracker component
Add Playwright E2E test suite for Task Tracker
Mar 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a comprehensive Playwright end-to-end test suite targeting a live Home Assistant instance, covering the full Task Tracker integration surface: config flow, sensor/button entities, frontend assets, and custom services.
Structure
40 tests total across 5 test modules.
Key design points
HA_TOKENinjected into browserlocalStorage— no UI login flow neededtask_tracker_entryfixture creates a config entry per-test and deletes it on teardown; all tests are idempotentha_get/ha_post/call_servicefixtures) avoid browser overhead; Playwright browser is only used where UI rendering mattersHOMEASSISTANT_URL(defaulthttp://localhost:8123) andHA_TOKENenv varsCI
.github/workflows/playwright.ymlspins up HA as a Docker service container, runs the onboarding flow to obtain a token, installs the component, and executes the suite.Original prompt
Goal
Add comprehensive Playwright end-to-end tests for the Task Tracker Home Assistant custom component.
Background
Task Tracker is a Home Assistant custom component that provides task management functionality with sensors, buttons, and frontend cards. This integration needs thorough E2E testing using Playwright to ensure all functionality works correctly in a real Home Assistant environment.
Requirements
Create Playwright tests in the
tests/playwrightdirectory that cover:Integration Setup Tests (
test_integration_setup.py):Sensor Tests (
test_sensors.py):Button Tests (
test_buttons.py):Frontend Tests (
test_frontend.py):Service Tests (
test_services.py):Technical Details
conftest.pywith fixtures for:HOMEASSISTANT_URL(default: http://localhost:8123)HA_TOKEN(if needed for API access)File Structure
Additional Files
Create:
tests/playwright/README.md- Documentation on how to run the teststests/playwright/requirements.txt- Python dependencies for tests.github/workflows/playwright.yml- GitHub Actions workflow for CI (optional)Notes
The following is the prior conversation context from the user's chat exploration (may be truncated):
User: I have mutliple repositories containing Home Assistant custom components (@gensyn/task_tracker, @gensyn/ssh_command, @gensyn/ssh_docker) that I want to thorougly test using Playwright. For that I plan to spin up a Home Assistant instance in a Docker container solely for testing purposes, but I need a target for testing SSH servers and Docker hosts as well. For that I want to create a Docker container, that uses Docker-in-Docker to spin up two instances of @billchurch/ssh_test. This way, the outer Docker container can be the target of SSH Docker, and the contained SSH servers can be used for testing SSH Command. Task Tracker does not have outside dependencies.
Create a
Dockerfilefile and adocker-compose.yamlfile that serve my described purpose and provide them here.After that, create Playwright tests for each of my mentioned repositories. Put them in their respective repository in a new branch under "tests/playwright" and create a pull request for each repository.
Assistant: I'll help you set up the testing infrastructure and create Playwright tests for your Home Assistant custom components. Let me start by gathering information about your repositories and then provide the Docker configuration files and create the PRs.
Assistant: Great! Now let me provide you with the Docker configuration files and then create the Playwright tests for each repository.
Docker Configuration Files
Here are the
Dockerfileanddocker-compose.yamlfiles for your testing setup: