import './dnd' ; declare global { namespace Cypress { interface Chainable { getByTestId ( selector , ... additionalArguments ) : Chainable < Element > ; } } } example Cypress . Commands . add ( 'getByTestId' , ( selector , ... args ) => { return cy . get ( `[data-cy="${ selector }"]` , ... args ) ; } ) ;