https://cypress.io logo
If that's just buttons, I would not use PageObject...
# best-practices
e
If that's just buttons, I would not use PageObjects. Creating a util function for your attribute might be enough:
Copy code
ts
const byState = (id: string) => {
  cy.get(`[data-state="${id}"]`)
}

it('my test', () => {
  cy.get(byState('test'))
})
5 Views