smartlocatoragent

生成稳定且易于维护的 UI 自动化定位器,支持 Playwright、Selenium 和 Appium。

仓库最近推送
GitHub Stars
156
Forks
59
Issues / PRs
0

安装方式

先用 Prompt 核对来源与依赖。也可下载安装包。

用 AI 助手安装

复制提示词,让助手先核对固定版本和依赖。

查看 Prompt收起 Prompt
先检查当前 Agent 是否已安装 SkillPI Skill Finder。如果尚未安装,请按官方仓库的说明安装并启用:https://github.com/Findskills/skillpi。然后使用 Skill Finder 打开此 SkillPI 详情页并定位 "smartlocatoragent":https://skillpi.com/zh/skills/deepskill-4e59de043b32a2e05957aed9294e7b70c2c5c36d4396e75a3a44f729ec6b5877。安装前核对上游来源和版本:https://github.com/anhtester/antigravity-testing-kit。来源不一致时停止并说明差异。核对通过后,用 Skill Finder 安装目标 Skill,并报告安装路径和来源版本。

来源与配置

github.com

配置方式待核实

请查看原始来源中的适用工具、依赖和权限要求。

安装实测待补充

生成稳定且易于维护的 UI 自动化定位器,支持 Playwright、Selenium 和 Appium。

0 下载

介绍来源: third_party · anhtester · 0.0.1 参考来源

SkillPi 解读

能完成的任务
翻译待完成,请参阅来源文档。
适合谁
翻译待完成,请参阅来源文档。
输入和输出
翻译待完成,请参阅来源文档。
实测状态
未测试

文件浏览

在原站浏览文件 ↗

原始 SKILL.md

打开原文 ↗
Frontmatter
name: Smart Locator Agent
description: Skill sinh locator ổn định và dễ bảo trì cho UI automation, hỗ trợ Playwright, Selenium và Appium.

Smart Locator Agent

Purpose: Generate stable and maintainable locators for UI automation.

Applicable frameworks:

  • Playwright
  • Selenium
  • Appium

When to Use

Use this skill when:

  • Generating locators for new UI elements
  • Reviewing existing locators for stability
  • Migrating locators between frameworks

Responsibilities

The agent must:

  1. Inspect the DOM or mobile UI hierarchy (NEVER guess)
  2. Identify stable attributes
  3. Generate a reliable locator
  4. Validate locator uniqueness
  5. Provide fallback locator if primary is fragile

Locator Priority

Use the following priority order:

  1. Accessibility attributes (aria-label, role)
  2. data-testid / data-test / data-qa
  3. id
  4. name
  5. Framework semantic locator
  6. css selector
  7. xpath (last option)

Note: For detailed rules, refer to .agent/rules/locator_strategy.md.


Playwright Locators

Preferred locator methods:

  1. getByRole() — Best for semantic elements
  2. getByLabel() — Best for form fields with labels
  3. getByPlaceholder() — Best for inputs with placeholder text
  4. getByText() — Best for text content
  5. getByTestId() — Best when data-testid is available

Example:

page.getByRole("button", { name: "Submit" })
page.getByLabel("Email")
page.getByPlaceholder("Enter your password")

Note: For detailed rules, refer to .agent/rules/playwright_rules.md.


Selenium Locators

Preferred order:

  1. id
  2. data-testid
  3. name
  4. cssSelector
  5. xpath

Example:

driver.findElement(By.id("login-button"));
driver.findElement(By.cssSelector("button[data-testid='submit-btn']"));

Note: For detailed rules, refer to .agent/rules/selenium_rules.md.


Appium Locators

Preferred order:

  1. accessibility id
  2. resource-id
  3. id
  4. iOS predicate string
  5. class chain
  6. xpath

Example:

driver.findElement(AppiumBy.accessibilityId("login_button"));
driver.findElement(AppiumBy.id("com.app:id/login_button"));
driver.findElement(AppiumBy.iOSNsPredicateString("label == 'Login'"));

Note: For detailed rules, refer to .agent/rules/appium_rules.md.


Validation Rules

Before using a locator, ensure:

  • [ ] It matches exactly one element
  • [ ] The element is visible and interactable
  • [ ] It is stable across page reloads
  • [ ] It survives cosmetic DOM changes (layout, styling)
  • [ ] It does NOT use dynamic class names or positional xpath

Output Format

When generating locators, provide:

  1. Primary locator — The best, most stable option
  2. Fallback locator — Alternative if primary breaks
  3. Reasoning — Why this locator was chosen

Rules References

  • .agent/rules/locator_strategy.md — Master locator priority map
  • .agent/rules/playwright_rules.md — Playwright-specific locator rules
  • .agent/rules/selenium_rules.md — Selenium-specific locator rules
  • .agent/rules/appium_rules.md — Appium-specific locator rules

当前收录版本

0.0.1

核对来源版本 ↗

安全与评测信息

质量评测

满分100 · 来自 SkillPi LAB 实验室的评测报告。

场景价值90/100

亮点

  • 直接解决UI自动化测试中的核心痛点,显著提升测试脚本的稳定性和维护性
  • 适用于广泛受众,支持Playwright、Selenium和Appium三大主流框架
触发精准85/100

待提升项

  • description语言不一致 原报告严重程度:轻微

    顶层description使用越南语,而skill_body使用英语,可能导致非越南语用户理解困难

    改进建议:建议统一使用英语或提供多语言支持

亮点

  • 触发词精准完整,覆盖多种变体,边界清晰
  • 提供了明确的使用场景和框架支持说明
结构规范80/100

待提升项

  • 文档过长 原报告严重程度:轻微

    文档内容较为详细,可能影响用户快速获取关键信息

    改进建议:建议将详细规则移至外部文档,保持主文档简洁

  • 引用文件缺失 原报告严重程度:轻微

    文档中引用了多个外部规则文件(.agent/rules/*.md),但未确认这些文件是否存在

    改进建议:确保所有引用的外部文件都存在且内容完整

亮点

  • Phase/步骤清晰,有出口条件,含端到端示例
  • frontmatter完整,结构良好
执行可靠85/100

亮点

  • 工具来源明确,参数正确,覆盖主要异常
  • 提供了详细的验证规则和输出格式,确保执行可靠性
证据可验 (前四项均值)85/100

取前四项原始分值的算术平均,四舍五入取整。可通过收录报告核对各项评分与说明,运行记录需单独查证。

正文静态检测

100 / 100 · skillpi-20261123-no-r3-v1

正文未命中当前规则。

分数仅反映正文中的规则命中,供使用前参考。附件与运行行为不在此评分范围内。

权限与使用前检查

根据当前主文档自动整理,命中内容可能是示例或防护说明;不是实际权限声明,也未覆盖附件、外部依赖或运行行为。

未从主文档识别到上述常见操作,不能据此判断无需权限或没有风险。

本站展示提示不会授予权限。涉及文件改动、密钥、外部发送或费用时,仍由你使用的工具按需确认。

安全评级与访问范围

safe · 静态证据核验,不代表运行安全保证。

使用前请由宿主核对并授权实际文件读写、外部服务和联网目的地;本站的核验不会授予任何运行权限。