-
Notifications
You must be signed in to change notification settings - Fork 13
feat: add automate self-heal tools integration #54
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
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 self-heal integration that fetches and suggests alternative selectors from BrowserStack session logs.
- Introduces a tool (
fetchSelfHealSelectorTool
) for retrieving healed selectors. - Implements utilities (
getSelfHealSelectors
&extractHealedSelectors
) to call BrowserStack’s logs API and parse selector mappings. - Registers the self-heal tool in the MCP server bootstrap.
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
File | Description |
---|---|
src/tools/selfheal.ts | Defines and registers the fetchSelfHealSelector tool |
src/tools/selfheal-utils/selfheal.ts | Implements HTTP call and parsing logic to extract healed selectors |
src/index.ts | Imports and wires up addSelfHealTools into the server initialization |
Comments suppressed due to low confidence (4)
src/tools/selfheal.ts:32
- [nitpick] The tool name is singular but returns multiple selectors; consider renaming to
fetchSelfHealSelectors
for clarity and consistency.
"fetchSelfHealSelector",
src/tools/selfheal.ts:8
- There are no unit tests for
fetchSelfHealSelectorTool
; consider adding tests to cover both successful fetch and error handling paths.
export async function fetchSelfHealSelectorTool(args: {
src/tools/selfheal-utils/selfheal.ts:15
- Buffer may not be defined in this context; consider importing
Buffer
from 'buffer' or ensuring the runtime environment provides a global Buffer.
const auth = Buffer.from(credentials).toString("base64");
src/tools/selfheal-utils/selfheal.ts:77
- [nitpick] Pairing healed selectors with requests by array index may misalign entries if counts differ; consider matching by log line proximity or timestamp for more reliable pairing.
for (let i = 0; i < minLength; i++) {
src/tools/selfheal.ts
Outdated
export default function addSelfHealTools(server: McpServer) { | ||
server.tool( | ||
"fetchSelfHealSelector", | ||
"Fetch self-healing selector suggestions for a broken selector", |
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.
update
added one comment |
Co-authored-by: Pulkit Sharma <[email protected]>
No description provided.