#264 — Add testid or similar attributes to locators

Repo: Twill-AI/twill-ai-ui State: closed | Status: done Assignee: raymondehizoba

Created: 2025-04-01 · Updated: 2025-05-15

Description

Check - https://playwright.dev/docs/locators#locate-by-test-id It’s one of the most reliable and resilient ways to find and work with locators for automation side Priority list:

  1. !!! Interactive elements - help to interact with specific elements
  • button,
  • link,
  • select,
  • input,
  • textarea,
  • etc

e.g <button data-test="submitButton">Submit</button>

  1. Containers - help to define scope for elements to search in (solves cases when 2+ elements have the same testid but lays on different levels of DOM)
  • div,
  • section,
  • form,
  • etc

e.g <div data-test="loginForm">...</div>

  1. Static objects (images, elements that contains only text, etc)

No dynamic generation for testids should be used TestId should be readable, stable and unique in scope of its module/container/component Any name could be used for the attribute, it is configurable on Automation Framework side

Notes

Add implementation notes, blockers, and context here

Add wikilinks to related people, meetings, or other tickets