diff --git a/capabilities/testdrive-jsui/Makefile b/capabilities/testdrive-jsui/Makefile index fed1ea7e..1d0f6e28 100644 --- a/capabilities/testdrive-jsui/Makefile +++ b/capabilities/testdrive-jsui/Makefile @@ -32,8 +32,10 @@ help: ## Show testdrive-jsui capability help @echo "Testing:" @echo " testdrive-jsui-test-js Run JavaScript tests only" @echo " testdrive-jsui-test-python Run Python tests only" + @echo " testdrive-jsui-test-js-fixes Run JavaScript fixes test" + @echo " testdrive-jsui-test-html Run HTML integration tests (opens in browser)" @echo " testdrive-jsui-test-integration Run Python-JS integration tests" - @echo " testdrive-jsui-test-all Run all tests (JS + Python + Integration)" + @echo " testdrive-jsui-test-all Run all tests (JS + Python + Integration + HTML)" @echo "" @echo "Development:" @echo " testdrive-jsui-lint-js Lint JavaScript code" @@ -45,6 +47,9 @@ help: ## Show testdrive-jsui capability help @echo " testdrive-jsui-status Show capability status" @echo " testdrive-jsui-clean Clean build artifacts" @echo " testdrive-jsui-info Show environment information" + @echo " testdrive-jsui-list-components List all UI components with descriptions" + @echo " testdrive-jsui-list-components-detailed List components with detailed info" + @echo " testdrive-jsui-list-components-json List components in JSON format" # Environment status check .PHONY: testdrive-jsui-status @@ -114,12 +119,42 @@ endif testdrive-jsui-test-python: ## Run Python tests only $(VENV_PYTHON) -m pytest tests/ -v +.PHONY: testdrive-jsui-test-js-fixes +testdrive-jsui-test-js-fixes: ## Run JavaScript fixes test + cd tests && $(VENV_PYTHON) test_js_fixes.py + +.PHONY: testdrive-jsui-test-html +testdrive-jsui-test-html: ## Run HTML integration tests (opens in browser) + @echo "๐ HTML Integration Tests:" + @echo "=============================" + @if command -v xdg-open > /dev/null 2>&1; then \ + echo "๐ Opening test_integration.html..."; \ + xdg-open tests/test_integration.html; \ + echo "๐ Opening test_guardrail_js.html..."; \ + xdg-open tests/test_guardrail_js.html; \ + echo "๐ Opening test_complete.html..."; \ + xdg-open tests/test_complete.html; \ + elif command -v open > /dev/null 2>&1; then \ + echo "๐ Opening test_integration.html..."; \ + open tests/test_integration.html; \ + echo "๐ Opening test_guardrail_js.html..."; \ + open tests/test_guardrail_js.html; \ + echo "๐ Opening test_complete.html..."; \ + open tests/test_complete.html; \ + else \ + echo "โ No browser opener found (need xdg-open or open command)"; \ + echo "๐ Manual test files:"; \ + echo " - $(shell pwd)/tests/test_integration.html"; \ + echo " - $(shell pwd)/tests/test_guardrail_js.html"; \ + echo " - $(shell pwd)/tests/test_complete.html"; \ + fi + .PHONY: testdrive-jsui-test-integration testdrive-jsui-test-integration: ## Run Python-JS integration tests $(VENV_PYTHON) -m pytest tests/ -v -m javascript .PHONY: testdrive-jsui-test-all -testdrive-jsui-test-all: ## Run all tests (JS + Python + Integration) +testdrive-jsui-test-all: ## Run all tests (JS + Python + Integration + HTML) @echo "๐งช Running all TestDrive-JSUI tests..." @echo "" ifndef NPM @@ -137,6 +172,17 @@ endif exit 1; \ fi @echo "" + @echo "๐ JavaScript Fixes Test:" + @echo "==========================" + @if cd tests && $(VENV_PYTHON) test_js_fixes.py > /tmp/js_fixes_results.log 2>&1; then \ + echo "โ JavaScript fixes test completed successfully"; \ + grep -E "(โ |โ)" /tmp/js_fixes_results.log | tail -5 || true; \ + else \ + echo "โ JavaScript fixes test failed"; \ + cat /tmp/js_fixes_results.log; \ + exit 1; \ + fi + @echo "" @echo "๐ Python Integration Tests (pytest):" @echo "======================================" @if $(VENV_PYTHON) -m pytest tests/ -v > /tmp/pytest_results.log 2>&1; then \ @@ -148,18 +194,28 @@ endif exit 1; \ fi @echo "" + @echo "๐ HTML Integration Tests:" + @echo "==========================" + @echo "โ HTML test files available for manual testing:" + @echo " - tests/test_integration.html (Integration test document)" + @echo " - tests/test_guardrail_js.html (Guardrail principle test)" + @echo " - tests/test_complete.html (Complete UI test)" + @echo " Run 'make testdrive-jsui-test-html' to open in browser" + @echo "" @echo "๐ฏ Combined Test Results Summary:" @echo "==================================" @js_tests=$$(grep "Tests:" /tmp/jest_results.log | grep -o "[0-9]\+ passed" | grep -o "[0-9]\+" || echo "0"); \ py_tests=$$(grep "passed" /tmp/pytest_results.log | tail -1 | grep -o "[0-9]\+ passed" | grep -o "[0-9]\+" || echo "0"); \ js_suites=$$(grep "Test Suites:" /tmp/jest_results.log | grep -o "[0-9]\+ passed" | grep -o "[0-9]\+" || echo "0"); \ - total_tests=$$((js_tests + py_tests)); \ + total_tests=$$((js_tests + py_tests + 1)); \ echo " ๐ JavaScript: $$js_tests tests in $$js_suites test suites - ALL PASSED โ "; \ + echo " ๐ JavaScript Fixes: 1 test - ALL PASSED โ "; \ echo " ๐ Python: $$py_tests integration tests - ALL PASSED โ "; \ - echo " ๐ Total: $$total_tests tests - ALL PASSED โ "; \ + echo " ๐ HTML: 3 manual test files - AVAILABLE โ "; \ + echo " ๐ Total: $$total_tests automated tests - ALL PASSED โ "; \ echo "" @echo "โ All TestDrive-JSUI tests completed successfully!" - @rm -f /tmp/jest_results.log /tmp/pytest_results.log + @rm -f /tmp/jest_results.log /tmp/pytest_results.log /tmp/js_fixes_results.log # Development targets .PHONY: testdrive-jsui-lint-js @@ -199,6 +255,18 @@ testdrive-jsui-clean: ## Clean build artifacts find . -type d -name __pycache__ -exec rm -rf {} + find . -type f -name "*.pyc" -delete +.PHONY: testdrive-jsui-list-components +testdrive-jsui-list-components: ## List all UI components with descriptions + $(VENV_PYTHON) scripts/list_components.py + +.PHONY: testdrive-jsui-list-components-detailed +testdrive-jsui-list-components-detailed: ## List all UI components with detailed information + $(VENV_PYTHON) scripts/list_components.py detailed + +.PHONY: testdrive-jsui-list-components-json +testdrive-jsui-list-components-json: ## List all UI components in JSON format + $(VENV_PYTHON) scripts/list_components.py json + .PHONY: testdrive-jsui-info testdrive-jsui-info: ## Show environment information @echo "๐งช TestDrive-JSUI Environment Information" @@ -227,6 +295,16 @@ endif else \ echo " No Python tests found"; \ fi + @echo "" + @echo "๐ Available HTML Test Files:" + @if [ -d "tests" ]; then \ + find tests -name "test_*.html" -type f | sed 's/^/ - /'; \ + else \ + echo " No HTML test files found"; \ + fi + @echo "" + @echo "๐ UI Components:" + @$(VENV_PYTHON) scripts/list_components.py 2>/dev/null | head -10 || echo " Component lister not available" # Integration with main capability system .PHONY: capability-info diff --git a/test_complete.html b/test_complete.html deleted file mode 100644 index a7431280..00000000 --- a/test_complete.html +++ /dev/null @@ -1,191 +0,0 @@ - - -
- - - -This document tests the complete UI control system with all controls.
-This section has various content types to test the controls:
-console.log('Hello World');
-| Feature | -Status | -
|---|---|
| Status Control | -โ Working | -
| Debug Control | -โ Working | -
| Contents Control | -โ Working | -
| Edit Control | -โ Working | -
More content to test the table of contents functionality.
--- html from markdown by MarkiTect on 2025-11-11 23:46:11 by worsch
-This is a test paragraph to verify that the status control can properly count and analyze document content.
-Another paragraph with some formatted text and emphasis.
-| Column 1 | -Column 2 | -Column 3 | -
|---|---|---|
| Row 1, Cell 1 | -Row 1, Cell 2 | -Row 1, Cell 3 | -
| Row 2, Cell 1 | -Row 2, Cell 2 | -Row 2, Cell 3 | -
Testing image counting (placeholder images):
-
-
- inline code- This is a blockquote to test various content types that the status control should analyze. -- -
-// This is a code block
-function testFunction() {
- return "Testing code block counting";
-}
-
- This document tests the JavaScript controls integration with the HTML output after the Guardrail Principle refactoring.
-This document contains various content types to test the status control functionality.
-Content in subsections should be properly counted.
-| Column A | -Column B | -Column C | -
|---|---|---|
| Row 1A | -Row 1B | -Row 1C | -
| Row 2A | -Row 2B | -Row 2C | -
def test_function():
- return "This code block should be counted"
---This is a blockquote that should be analyzed by the status control.
-
The JavaScript controls should: -1. Initialize successfully with proper error handling -2. Display accurate document statistics -3. Provide interactive drag/resize functionality -4. Work with the debug system integration -5. Handle errors gracefully per the Guardrail Principle
-This test will verify that our external JavaScript files work correctly with the HTML template system.
--- html from markdown by MarkiTect on 2025-11-11 22:10:30 by worsch
-