Skip to content

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

tech-sushant
Copy link
Contributor

No description provided.

@tech-sushant tech-sushant marked this pull request as ready for review May 23, 2025 13:10
@pulkitsharma07 pulkitsharma07 requested a review from Copilot May 23, 2025 13:33
Copy link

@Copilot Copilot AI left a 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++) {

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant