https://cypress.io logo
the reason I wonder is it better to do something l...
# best-practices
g
the reason I wonder is it better to do something like this: pageobject.ts
Copy code
ts

  static get testButton() {
    return cy.get('[data-state="test"]');
  }

then in test I call

pageObject.testButton
Or straight away just do
Copy code
ts
cy.get('[data-state="test"]');
in the test file?
2 Views