Let's say I have a variable username.
Now, my chainable function wants to check if the username is empty or not.
Before:
if(username !== "") {
cy.get('#username').type(username)
}
After (Expectation):
cy.get('#username').type(username).ifNotEmpty() //ifNotEmpty will be my chainable func
So my question is Is this even possible? If yes, then how?