Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Autogenerate testId based on field name - all Tiller components #272

Open
vbiankini opened this issue Jun 28, 2024 · 0 comments
Open

Autogenerate testId based on field name - all Tiller components #272

vbiankini opened this issue Jun 28, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@vbiankini
Copy link

vbiankini commented Jun 28, 2024

Basic information

  • Tiller version:
    Tiller version: v1.14.2
  • Module: -

Additional information

None.

Enhancement description

Test Id is added to all Tiller component so finding a field is much faster, easier and more reliable.

Current behaviour

Some components like toggle buttons, upload file component, buttons do not have any test Id like it is with input field (testId: input-firstName) so I need to find a component by it's label, for example label. r('div').filter({ hasText: /^Show All$/ }).

Wanted behaviour

We want the data-testid to be generated for all Tiller components based on the field name.
That would enable our automated testing code to find these fields via their id, whereas now the field can't be found directly/reliably.

This is the preferred method of finding elements. For example, this is a code sample from Playwright framework:
await page.getByTestId('checkbox-showAll').click();

Possible workarounds

As a workaround, we currently try and find the toggle by looking up the label associated with it and then looking for the checkbox inside that div.

@vbiankini vbiankini added the enhancement New feature or request label Jun 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant