DEV Community

Discussion on: Page Object Pattern + Reusable Functions in Cypress

Collapse
nikomadar profile image
Niko • Edited on

You can still do assertions if you write your elements in the POM class to return the cy objects.

Example:
usernameField(){
return cy.get(#username)
}

And then in your test file you can just chain cy commands of it.

loginPage.usernameField().should('be.visible')