cumulocity-cypress
Version:
Cypress commands for Cumulocity IoT
25 lines (24 loc) • 1.12 kB
TypeScript
import { C8yAuthOptions } from "../../shared/auth";
declare global {
namespace Cypress {
interface Chainable {
/**
* Login to Cumulocity using OAuth Internal. Returns `C8yAuthOptions` object containing
* required login information including xsrf and authorization tokens. The user and password
* will be read from environment and can be passed from cy.getAuth(). The authorization and
* x-xsrf-token cookies will be set in the browser.
*
* Obtaining an OAI-Secure access token via /tenant/oauth/token endpoint is currently
* not supported.
*
* @example
* cy.getAuth("admin", "password").oauthLogin();
* cy.oauthLogin("admin", "password");
*/
oauthLogin(): Chainable<C8yAuthOptions>;
oauthLogin(auth: C8yAuthOptions): Chainable<C8yAuthOptions>;
oauthLogin(user: string, password: string): Chainable<C8yAuthOptions>;
oauthLogin(userAlias: string): Chainable<C8yAuthOptions>;
}
}
}