Skip to content

Conversation

@JungHoe
Copy link

@JungHoe JungHoe commented Jan 26, 2026

Description

This PR addresses an issue where elements were not being optimally identified for testing and automation workflows. It introduces support for a configurable priorityAttribute (defaulting to data-testid), allowing Agentation to generate more robust and reliable selectors.

Changes

  • Core Logic: Updated getElementPath, identifyElement, and getFullElementPath utilities to accept and prioritize a priorityAttribute.
  • Component: Added priorityAttribute prop to Agentation (default: "data-testid").
  • Documentation: Updated API docs and Example app to demonstrate the new feature.
  • Example: Added data-testid attributes to demo elements in the example app for immediate verification.

How to Test

  1. Run the example app: cd _package-export/example && npm run dev
  2. Open http://localhost:3000
  3. Click on the "Primary Button" or "Example Card"
  4. Verify that the annotation path uses [data-testid="..."] instead of generic classes or tags.

@vercel
Copy link

vercel bot commented Jan 26, 2026

@JungHoe is attempting to deploy a commit to the Benji Taylor's Projects Team on Vercel.

A member of the Team first needs to authorize it.

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