Created
July 29, 2020 22:42
Cypress Tips/Tricks - Typing Custom Commands
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
declare namespace Cypress { | |
interface Chainable<Subject> { | |
// Typing out all of our custom commands i.e. cy.login(...) | |
/** | |
* Logging in to a user directly through the API | |
* It returns the auth token in the .then on success | |
* @example | |
* cy.login('username', 'password123') | |
*/ | |
login(username: string, password: string): Chainable<string>; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment