In Cypress, I want to select a button from a group of buttons based on its text-content. How can I do it? Here is my approach:
export const getCustomerButton = (
This will yield the DOM element with YOUR_BUTTON_CLASS which contains text 'Customer'. Is that what you're looking for?
YOUR_BUTTON_CLASS
cy.get('YOUR_BUTTON_CLASS').contains('Customer');
Here the documentation for .contains cypress command.
.contains