declare namespace Cypress { interface Chainable < Subject > { login ( url ) : void ; verifyMetaTag ( name , text ) : void ; } } Cypress . Commands . add ( 'login' , ( url ) => { cy . visit ( '/admin' ) ; cy . get ( '[data-testid=sign-in-button]' ) . click ( ) . contains ( 'Sign Out' ) . get ( `a[href="${ url }"]` ) . click ( ) ; } ) ; Cypress . Commands . add ( 'verifyMetaTag' , ( name , text ) => { cy . get ( `head meta[name=${ name }]` ) . should ( 'have.attr' , 'content' , text ) ; } ) ; Cypress . Commands . add ( 'loginWithSecurity' , ( ) => { cy . request ( { method : 'POST' , url : 'http://localhost:3000/api/users/login' , body : { user : { email : 'milan@darkrush.photo' , password : 'password' , } , } , } ) . then ( ( resp ) => { window . localStorage . setItem ( 'jwt' , resp . body . user . token ) ; } ) ; } ) ;