R020: .id重复

Detect duplicate .id('xxx') string arguments in XTS source code.

31|6|Updated Jan 29, 2026
One-click install
npx skills add https://github.com/openharmonyinsight/openharmony-skills --skill r020-id
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: R020: .id重复
Source: https://github.com/openharmonyinsight/openharmony-skills/tree/main/skills/check-test-code-quality/rules/R020
Command: npx skills add https://github.com/openharmonyinsight/openharmony-skills --skill r020-id

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This rule prevents UI component identity collisions by detecting duplicate .id('...') string parameters inside the same independent XTS engineering scope.

Core Features & Use Cases

  • Detect duplicate .id() strings: Scans all source files in one independent XTS project and flags repeated .id('xxx') values.
  • Project-level isolation: Treats each independent XTS project as the boundary, so duplicates are checked only within that scope.
  • Actionable reporting: Produces Critical findings including first occurrence location, repeated count, and other locations to speed up remediation.

Use case: When multiple UI pages or test components reuse the same .id value within one XTS project, automated element lookup and page operations can become unreliable; use this rule to enforce uniqueness and stabilize tests.

Quick Start

Run the R020 check on your XTS project sources to receive a Critical report listing all duplicate .id('...') values and where they occur.

Frequently Asked Questions about R020: .id重复

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I find duplicate .id values in XTS UI test code?

Scanning all .ets, .ts, and .js files within an independent XTS project boundary detects repeated .id('xxx') string arguments to help you find duplicate .id values in XTS UI test code.

Why does my XTS UI test fail to locate components during automated element lookup?

Automated element lookup in XTS UI tests fails when multiple UI pages or test components reuse the same .id value within one project, causing identity collisions and unreliable page operations.

Can I check for duplicate .id strings across multiple independent XTS projects simultaneously?

No, duplicate .id detection applies project-level isolation by treating each independent XTS project as the boundary, ensuring .id uniqueness is checked only within that specific scope.

What details are included in duplicate .id detection reports for ArkTS source files?

Critical severity duplicate .id detection reports provide the first occurrence location, the duplicate count, and other matching locations across ArkTS source files to speed up remediation.

What file types are scanned when detecting UI component identity collisions in XTS?

Scanning all .ets, .ts, and .js source files within the project boundary flags repeated .id string parameters to detect UI component identity collisions in XTS.