DEV Community

Discussion on: Page Object Pattern + Reusable Functions in Cypress

Collapse
 
ajdinmust profile image
Ajdin Mustafić

Hi Nenad! Thanks for the question. If needed, I assert directly in the function, so it is completely standalone.

Collapse
 
nikomadar profile image
Niko • Edited

I prefer to do the assertions in the test file. Becuase then the POM element can be used for various assertions without having to duplicate them.
Also the test should be where all the checks take place. If the check is in an external function then we lose test clarity.