# TestDrive-JSUI Capability Makefile # JavaScript UI testing framework for MarkiTect # Capability metadata CAPABILITY_NAME := testdrive-jsui CAPABILITY_DESCRIPTION := JavaScript UI testing framework with Python integration # Python virtual environment detection VENV_PYTHON := $(shell which python3 2>/dev/null || which python 2>/dev/null) ifeq ($(VENV_PYTHON),) VENV_PYTHON := python endif # Node.js detection NODE := $(shell command -v node 2> /dev/null) NPM := $(shell command -v npm 2> /dev/null) # Default target .PHONY: help help: ## Show testdrive-jsui capability help @echo "๐Ÿงช TestDrive-JSUI Capability" @echo "============================" @echo "" @echo "JavaScript UI Testing Framework for MarkiTect" @echo "" @echo "Environment Setup:" @echo " testdrive-jsui-install Install Python package" @echo " testdrive-jsui-install-dev Install with development dependencies" @echo " testdrive-jsui-install-js Install JavaScript dependencies" @echo " testdrive-jsui-setup Complete setup (Python + JavaScript)" @echo "" @echo "Testing:" @echo " testdrive-jsui-test-js Run JavaScript tests only" @echo " testdrive-jsui-test-python Run Python tests only" @echo " testdrive-jsui-test-integration Run Python-JS integration tests" @echo " testdrive-jsui-test-all Run all tests (JS + Python + Integration)" @echo "" @echo "Development:" @echo " testdrive-jsui-lint-js Lint JavaScript code" @echo " testdrive-jsui-lint-python Lint Python code" @echo " testdrive-jsui-format-python Format Python code with black" @echo " testdrive-jsui-watch Watch mode for JavaScript tests" @echo "" @echo "Utilities:" @echo " testdrive-jsui-status Show capability status" @echo " testdrive-jsui-clean Clean build artifacts" @echo " testdrive-jsui-info Show environment information" # Environment status check .PHONY: testdrive-jsui-status testdrive-jsui-status: ## Show capability status @echo "๐Ÿงช TestDrive-JSUI Status" @echo "========================" @echo "" ifdef NODE @echo "โœ… Node.js: $(shell node --version)" else @echo "โŒ Node.js: Not found" endif ifdef NPM @echo "โœ… npm: $(shell npm --version)" else @echo "โŒ npm: Not found" endif @echo "โœ… Python: $(shell $(VENV_PYTHON) --version)" @if [ -f "package.json" ]; then \ echo "โœ… package.json: Available"; \ else \ echo "โŒ package.json: Missing"; \ fi @if [ -f "pyproject.toml" ]; then \ echo "โœ… pyproject.toml: Available"; \ else \ echo "โŒ pyproject.toml: Missing"; \ fi @if [ -d "node_modules" ]; then \ echo "โœ… JavaScript dependencies: Installed"; \ else \ echo "โŒ JavaScript dependencies: Not installed"; \ fi @echo "" # Installation targets .PHONY: testdrive-jsui-install testdrive-jsui-install: ## Install Python package $(VENV_PYTHON) -m pip install -e . .PHONY: testdrive-jsui-install-dev testdrive-jsui-install-dev: ## Install with development dependencies $(VENV_PYTHON) -m pip install -e ".[dev,testing]" .PHONY: testdrive-jsui-install-js testdrive-jsui-install-js: ## Install JavaScript dependencies ifndef NPM @echo "โŒ npm not found. Please install Node.js and npm first." @exit 1 endif npm install .PHONY: testdrive-jsui-setup testdrive-jsui-setup: testdrive-jsui-install-dev testdrive-jsui-install-js ## Complete setup (Python + JavaScript) @echo "โœ… TestDrive-JSUI setup complete!" # Testing targets .PHONY: testdrive-jsui-test-js testdrive-jsui-test-js: ## Run JavaScript tests only ifndef NPM @echo "โŒ npm not found. Run 'make testdrive-jsui-install-js' first." @exit 1 endif npm test .PHONY: testdrive-jsui-test-python testdrive-jsui-test-python: ## Run Python tests only $(VENV_PYTHON) -m pytest tests/ -v .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) @echo "๐Ÿงช Running all TestDrive-JSUI tests..." @echo "" ifndef NPM @echo "โŒ npm not found. Run 'make testdrive-jsui-install-js' first." @exit 1 endif @echo "๐Ÿ“‹ JavaScript Tests:" npm test @echo "" @echo "๐Ÿ“‹ Python Tests:" $(VENV_PYTHON) -m pytest tests/ -v @echo "" @echo "โœ… All tests completed!" # Development targets .PHONY: testdrive-jsui-lint-js testdrive-jsui-lint-js: ## Lint JavaScript code ifndef NPM @echo "โŒ npm not found. Run 'make testdrive-jsui-install-js' first." @exit 1 endif npm run lint .PHONY: testdrive-jsui-lint-python testdrive-jsui-lint-python: ## Lint Python code $(VENV_PYTHON) -m flake8 src/ tests/ .PHONY: testdrive-jsui-format-python testdrive-jsui-format-python: ## Format Python code with black $(VENV_PYTHON) -m black src/ tests/ .PHONY: testdrive-jsui-watch testdrive-jsui-watch: ## Watch mode for JavaScript tests ifndef NPM @echo "โŒ npm not found. Run 'make testdrive-jsui-install-js' first." @exit 1 endif npm run test:watch # Utility targets .PHONY: testdrive-jsui-clean testdrive-jsui-clean: ## Clean build artifacts rm -rf build/ rm -rf dist/ rm -rf *.egg-info/ rm -rf .pytest_cache/ rm -rf coverage/ rm -rf .coverage rm -rf node_modules/.cache/ find . -type d -name __pycache__ -exec rm -rf {} + find . -type f -name "*.pyc" -delete .PHONY: testdrive-jsui-info testdrive-jsui-info: ## Show environment information @echo "๐Ÿงช TestDrive-JSUI Environment Information" @echo "=========================================" @echo "" @echo "๐Ÿ“ Capability Root: $(shell pwd)" @echo "๐Ÿ Python: $(VENV_PYTHON)" @echo "๐Ÿ“ฆ Python Version: $(shell $(VENV_PYTHON) --version)" ifdef NODE @echo "๐ŸŸข Node.js: $(shell node --version)" @echo "๐Ÿ“ฆ npm: $(shell npm --version)" else @echo "โŒ Node.js: Not available" endif @echo "" @echo "๐Ÿ“‹ Available JavaScript Tests:" @if [ -d "js/tests" ]; then \ find js/tests -name "*.js" -type f | sed 's/^/ - /'; \ else \ echo " No JavaScript tests found"; \ fi @echo "" @echo "๐Ÿ“‹ Available Python Tests:" @if [ -d "tests" ]; then \ find tests -name "test_*.py" -type f | sed 's/^/ - /'; \ else \ echo " No Python tests found"; \ fi # Integration with main capability system .PHONY: capability-info capability-info: ## Show capability information @echo "Name: $(CAPABILITY_NAME)" @echo "Description: $(CAPABILITY_DESCRIPTION)" @echo "Type: JavaScript Testing Framework" @echo "Status: Development" @echo "Targets:" @$(MAKE) --no-print-directory help | grep "^ " | sed 's/^ / /' # Quick start target .PHONY: testdrive-jsui-quickstart testdrive-jsui-quickstart: ## Quick start: setup and run basic tests @echo "๐Ÿš€ TestDrive-JSUI Quick Start" @echo "=============================" @echo "" @echo "๐Ÿ“‹ Step 1: Installing dependencies..." @$(MAKE) --no-print-directory testdrive-jsui-setup @echo "" @echo "๐Ÿ“‹ Step 2: Running status check..." @$(MAKE) --no-print-directory testdrive-jsui-status @echo "" @echo "๐Ÿ“‹ Step 3: Running basic tests..." @$(MAKE) --no-print-directory testdrive-jsui-test-python @echo "" @echo "โœ… Quick start complete! Use 'make testdrive-jsui-help' for more options." # Standard test target for capability discovery system compatibility .PHONY: test test: ## Run all tests (required for capability integration) @$(MAKE) --no-print-directory testdrive-jsui-test-all