calcom/cypress/support/commands.ts
Alex Johansson 7e6e935ed3
add free plan (#549)
- add new fields to support this
- when free:
  - fade out all event types after first
  - hide events after first on booking page
  - make booking page after the first one 404 if accessed directly
- add e2e tests
2021-09-06 13:51:15 +00:00

26 lines
627 B
TypeScript

/* eslint-disable @typescript-eslint/no-namespace */
declare global {
namespace Cypress {
interface Chainable {
login(email: string, password: string): Chainable;
}
}
}
Cypress.Commands.add("login", (email: string, password: string) => {
cy.log(` 🗝 Logging in with ${email}`);
Cypress.Cookies.defaults({
preserve: /next-auth/,
});
cy.clearCookies();
cy.clearCookie("next-auth.session-token");
cy.reload();
cy.get("[name=email]").focus().clear().type(email);
cy.get("[name=password]").focus().clear().type(password);
cy.get("[type=submit]").click();
cy.wait(500);
});
export {};