I'm facing an issue with clicking a button using the following code:
await page.getByRole('button', { name: '3 Employees' }).click();
The problem is that the button's name fluctuates based on the number of employees, causing the hardcoded value to fail. Using a locator method with only the word 'Employees' could result in matching another button with the same locator and text. I also want to avoid using nth() method.
What I aim to achieve is modifying the code so it searches only for the 'Employees' part, including the space between 3 and 'Employees'. Is there any way to consider the 3 as a random value like "{randomvalue} Employees"?