nuxt / nuxt/ui

ID inheritance for E2E testing

Open
#6,835 0 comments 4 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

triage
Dominant language
TypeScript
Stars
6.9k
Forks
1.1k
Avg merge
1d 7h
Merged PRs (30d)
57

Description

Package

v4.x

Description

Hello
We are currently using PlayWright for E2E testing.
We are aware of data-testid attribute, but placing it everywhere and maintaing will be hell.
For easier dev exp. and test, it would be very cool for children component of parent inherit the id of parent and assign it in their own dynamic one.
For example we set USelect id = "countries", so USelect options would have id="reka-combobox-item-countries-0" etc.
Or in case of usage of multiple language localization in project, we would just access data-value if not id. That covers combobox , listbox, tabs items.

Additional context

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the USelect implementation and its combobox, listbox, and tabs item components. Check how Playwright E2E tests currently locate these elements; done means a parent id such as "countries" produces predictable child ids or usable data-value selectors without placing data-testid attributes everywhere.

Written by the indexing model from the issue text.

Assessment

Tech stack
playwright, typescript
Domain
frontend, testing-qa
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.