{"id":28948840,"url":"https://github.com/phmatray/autotestid","last_synced_at":"2026-01-20T16:27:18.056Z","repository":{"id":298892642,"uuid":"1001459131","full_name":"phmatray/AutoTestId","owner":"phmatray","description":null,"archived":false,"fork":false,"pushed_at":"2025-11-25T23:40:59.000Z","size":28,"stargazers_count":0,"open_issues_count":10,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-11-29T03:44:56.445Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/phmatray.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-06-13T12:18:29.000Z","updated_at":"2025-06-13T12:19:42.000Z","dependencies_parsed_at":"2025-06-13T13:30:01.124Z","dependency_job_id":"670556cf-cc66-4e9c-824b-a5f8b8c53261","html_url":"https://github.com/phmatray/AutoTestId","commit_stats":null,"previous_names":["phmatray/autotestid"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/phmatray/AutoTestId","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phmatray%2FAutoTestId","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phmatray%2FAutoTestId/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phmatray%2FAutoTestId/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phmatray%2FAutoTestId/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/phmatray","download_url":"https://codeload.github.com/phmatray/AutoTestId/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phmatray%2FAutoTestId/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28607060,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-20T16:10:39.856Z","status":"ssl_error","status_checked_at":"2026-01-20T16:10:39.493Z","response_time":117,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-06-23T11:05:51.490Z","updated_at":"2026-01-20T16:27:18.042Z","avatar_url":"https://github.com/phmatray.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# AutoTestId\n\nA .NET tool for automatically adding `data-testid` attributes to Razor components for improved testability.\n\n## Features\n\n- **Automatic test-id injection**: Adds `data-testid` attributes to root-level HTML elements in Razor files\n- **Multiple processing modes**: Process single files, folders, projects, or entire solutions\n- **Smart detection**: Only processes files that need updates\n- **Preserve formatting**: Maintains your existing code formatting and indentation\n- **Replace existing**: Updates existing `data-testid` attributes if present\n- **Dry-run mode**: Preview changes before applying them\n- **Beautiful CLI**: User-friendly command-line interface with progress reporting\n\n## Installation\n\n```bash\ndotnet tool install -g AutoTestId\n```\n\nOr build from source:\n\n```bash\ngit clone https://github.com/yourusername/AutoTestId.git\ncd AutoTestId\ndotnet build\n```\n\n## Usage\n\n### Process a Single File\n\n```bash\nautotestid file Component.razor\n\n# With custom test-id\nautotestid file Component.razor --test-id \"MyCustomId\"\n\n# Preview changes without modifying\nautotestid file Component.razor --dry-run\n```\n\n### Process a Folder\n\n```bash\nautotestid folder ./src\n\n# Process recursively (default)\nautotestid folder ./src --recursive\n\n# Exclude specific directories\nautotestid folder ./src --exclude bin --exclude obj\n\n# Custom file pattern\nautotestid folder ./src --pattern \"*.razor\"\n```\n\n### Process a Project\n\n```bash\nautotestid project MyApp.csproj\n\n# Preview changes\nautotestid project MyApp.csproj --dry-run\n\n# Exclude directories\nautotestid project MyApp.csproj --exclude wwwroot\n```\n\n### Process a Solution\n\n```bash\nautotestid solution MyApp.sln\n\n# Exclude specific projects\nautotestid solution MyApp.sln --exclude-project \"Tests\"\n\n# Include test projects (excluded by default)\nautotestid solution MyApp.sln --include-tests\n\n# Process only specific projects\nautotestid solution MyApp.sln --include-project \"MyApp.Web\" --include-project \"MyApp.Components\"\n```\n\n## How It Works\n\nAutoTestId processes Razor files and adds `data-testid` attributes to all root-level HTML elements:\n\n**Before:**\n```razor\n\u003cdiv class=\"card\"\u003e\n    \u003ch2\u003e@Title\u003c/h2\u003e\n    \u003cp\u003e@Description\u003c/p\u003e\n\u003c/div\u003e\n\n\u003cfooter\u003e\n    \u003cspan\u003e@Copyright\u003c/span\u003e\n\u003c/footer\u003e\n```\n\n**After:**\n```razor\n\u003cdiv data-testid=\"ProductCard\" class=\"card\"\u003e\n    \u003ch2\u003e@Title\u003c/h2\u003e\n    \u003cp\u003e@Description\u003c/p\u003e\n\u003c/div\u003e\n\n\u003cfooter data-testid=\"ProductCard\"\u003e\n    \u003cspan\u003e@Copyright\u003c/span\u003e\n\u003c/footer\u003e\n```\n\nThe test-id value is derived from the component filename (without extension) by default.\n\n## Command Reference\n\n### Global Options\n\n- `-h, --help` - Show help information\n- `-v, --version` - Show version information\n\n### File Command\n\nProcess a single Razor file.\n\n**Arguments:**\n- `\u003cFILE\u003e` - Path to the Razor file to process\n\n**Options:**\n- `-t, --test-id \u003cID\u003e` - Custom test ID value to use (defaults to filename)\n- `-d, --dry-run` - Preview changes without modifying files\n\n### Folder Command\n\nProcess all Razor files in a folder.\n\n**Arguments:**\n- `\u003cFOLDER\u003e` - Path to the folder containing Razor files\n\n**Options:**\n- `-r, --recursive` - Process subdirectories recursively (default: true)\n- `-p, --pattern \u003cPATTERN\u003e` - File pattern to match (default: *.razor)\n- `-d, --dry-run` - Preview changes without modifying files\n- `-e, --exclude \u003cDIR\u003e` - Directories to exclude (can be specified multiple times)\n\n### Project Command\n\nProcess all Razor files in a .csproj project.\n\n**Arguments:**\n- `\u003cPROJECT\u003e` - Path to the .csproj file\n\n**Options:**\n- `-d, --dry-run` - Preview changes without modifying files\n- `-l, --include-linked` - Include linked files in processing\n- `-e, --exclude \u003cDIR\u003e` - Directories to exclude (can be specified multiple times)\n\n### Solution Command\n\nProcess all Razor files in a .sln solution.\n\n**Arguments:**\n- `\u003cSOLUTION\u003e` - Path to the .sln file\n\n**Options:**\n- `-d, --dry-run` - Preview changes without modifying files\n- `-i, --include-project \u003cNAME\u003e` - Specific projects to include (can be specified multiple times)\n- `-e, --exclude-project \u003cNAME\u003e` - Projects to exclude (can be specified multiple times)\n- `-t, --include-tests` - Include test projects in processing\n\n## Development\n\n### Running Tests\n\n```bash\ndotnet test\n```\n\n### Building\n\n```bash\ndotnet build\n```\n\n### Running Locally\n\n```bash\ndotnet run -- file MyComponent.razor\n```\n\n## License\n\nMIT License - see LICENSE file for details.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphmatray%2Fautotestid","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fphmatray%2Fautotestid","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphmatray%2Fautotestid/lists"}