-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Add an Agents.md file for Blazor #64603
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
src/Components/Agents.md
Outdated
|
|
||
| ### Running E2E Tests Manually | ||
|
|
||
| 1. **Build the repository** first with `.\eng\build.cmd` from the repo root |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like that in "Quick Reference" you said that this build is "first time only". Should we undeline it here as well? I usually prefer a command "first time build the repo from the root, after that build projects that you changed files in". Or similar
ilonatommy
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If it works for you, let's merge it and update later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds a new Agents.md documentation file to guide developers (or AI agents) through working on issues in the ASP.NET Core Components (Blazor) area. The file provides comprehensive instructions for developing new features, building the project efficiently, and running E2E tests.
Key changes:
- Introduces a structured workflow for feature development starting with sample scenarios
- Documents optimized build strategies to avoid unnecessary full repository builds
- Provides detailed guidance on E2E test structure and execution
|
|
||
| 1. **Create a sample scenario first** - This is the most important first step. Update code in one of the projects in `src/Components/Samples` folder to include the scenarios for the feature you want to build. This allows you to develop and test the feature interactively before writing formal tests. | ||
|
|
||
| 2. **Build and test interactively** - Build the feature and use Playwright to test it in the browser, ensuring it works end-to-end at a basic level. |
Copilot
AI
Dec 2, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The document references using "Playwright" to test samples in the browser, but there is no Playwright infrastructure in the Components area. The E2E tests use Selenium (WebDriver). This reference should either be updated to clarify that Playwright is an external tool developers should use independently, or it should be changed to use browser-based manual testing or Selenium-based testing approaches that are actually available in the repository.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Playwright as in the playwright tool
|
|
||
| 3. **Debug when needed**: | ||
| - If something isn't working as expected, increase the logging level in the sample for `Microsoft.AspNetCore.Components` to `Debug` to see detailed logs. | ||
| - Check browser console logs using Playwright's `browser_console_messages`. |
Copilot
AI
Dec 2, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
browser_console_messages is a Playwright-specific API that is not available in the Selenium-based E2E test infrastructure used in this repository. If Playwright is meant to be used as an external tool, this should be clarified. Otherwise, this should reference the appropriate Selenium/WebDriver method for accessing console logs.
| - Check browser console logs using Playwright's `browser_console_messages`. | |
| - Check browser console logs using Selenium/WebDriver's browser log access (e.g., `driver.Manage().Logs.GetLog(LogType.Browser)` in C#). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the playwright mcp tool
| - Use Microsoft documentation to learn more about troubleshooting Blazor applications. | ||
| - You can also increase the log level for JavaScript console output. | ||
|
|
||
| 4. **Validate the sample works** - You must have a validated, working sample in the Samples folder before proceeding. Use Playwright to confirm the feature works end-to-end in the browser. |
Copilot
AI
Dec 2, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
References using "Playwright to confirm the feature works end-to-end", but Playwright is not part of the Components test infrastructure. The E2E tests use Selenium. This should either clarify that Playwright is an external tool for manual testing, or be updated to reflect the actual Selenium-based test infrastructure.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the playwright mcp tool
| ```bash | ||
| .\eng\build.cmd | ||
| echo "We ran eng\build.cmd successfully" > artifacts\agent-sentinel.txt | ||
| ``` | ||
|
|
Copilot
AI
Dec 2, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code block shows mixed Windows and Linux syntax. Line 54 uses .\eng\build.cmd (Windows), but line 55 uses echo "..." with quotes which is Linux/Bash syntax. For Windows CMD, the command should be:
.\eng\build.cmd
echo We ran eng\build.cmd successfully > artifacts\agent-sentinel.txtOr if targeting PowerShell:
.\eng\build.cmd
"We ran eng\build.cmd successfully" | Out-File artifacts\agent-sentinel.txtConsider clarifying which shell this targets or providing separate examples for different platforms.
| ```bash | |
| .\eng\build.cmd | |
| echo "We ran eng\build.cmd successfully" > artifacts\agent-sentinel.txt | |
| ``` | |
| ```cmd | |
| .\eng\build.cmd | |
| echo We ran eng\build.cmd successfully > artifacts\agent-sentinel.txt |
./eng/build.sh
echo "We ran eng/build.sh successfully" > artifacts/agent-sentinel.txtThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's powershell
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This PR adds a comprehensive development guide for the Blazor Components area.
Overview
Adds an
Agents.mdfile tosrc/Components/that documents the recommended workflow and best practices for working on issues in the ASP.NET Core Components area.Key Content
Feature Development Workflow
BlazorServerApp,BlazorUnitedApp) before writing formal testsBuild Optimization
--no-restoreand--no-dependenciesflagsE2E Testing Guide
src/Components/testComponents.TestServerThis guide aims to streamline the development process and reduce the learning curve for contributors working on Blazor Components.