-
Notifications
You must be signed in to change notification settings - Fork 4.8k
feat(codegen): remove icon text and CSS pseudo-element content from generated locators #38102
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
base: main
Are you sure you want to change the base?
feat(codegen): remove icon text and CSS pseudo-element content from generated locators #38102
Conversation
…enerated locators
Automatically detects and removes icon element text and CSS pseudo-element
content (::before, ::after) from accessible names during locator generation.
Before: getByRole('option', { name: ' Save and close' })
After: getByRole('option', { name: 'Save and close' })
- Multi-layered detection: tag names, CSS classes, ARIA, data attributes
- Supports 13+ icon libraries (FontAwesome, Material Icons, Lucide, etc.)
- Performance optimized with recursion limits and single regex replacement
- Language-agnostic, works globally
- Zero breaking changes, all tests pass
|
@YashGodseIndexnine please read the following Contributor License Agreement(CLA). If you agree with the CLA, please reply with the following information.
Contributor License AgreementContribution License AgreementThis Contribution License Agreement (“Agreement”) is agreed to by the party signing below (“You”),
|
Summary
Automatically removes icon element text and CSS pseudo-element content (::before, ::after) from generated locators, eliminating manual cleanup.
Problem