mirror of
https://github.com/PostHog/posthog.git
synced 2024-11-22 17:24:15 +01:00
34 lines
992 B
TypeScript
34 lines
992 B
TypeScript
/// <reference types="cypress" />
|
|
|
|
declare global {
|
|
// eslint-disable-next-line @typescript-eslint/no-namespace
|
|
namespace Cypress {
|
|
interface Chainable {
|
|
/**
|
|
* Custom command to login to PostHog
|
|
*/
|
|
login(): Chainable<Element>
|
|
|
|
/**
|
|
* Custom command to click a navigation menu item
|
|
* @example cy.clickNavMenu('dashboards')
|
|
*/
|
|
clickNavMenu(name: string): Chainable<Element>
|
|
|
|
/**
|
|
* Custom command to set subscription status
|
|
* @example cy.useSubscriptionStatus('unsubscribed')
|
|
*/
|
|
useSubscriptionStatus(name: 'unsubscribed' | 'subscribed'): Chainable<Element>
|
|
}
|
|
}
|
|
}
|
|
|
|
export const auth = {
|
|
logout: (): void => {
|
|
cy.get('[data-attr=menu-item-me]').click()
|
|
cy.get('[data-attr=top-menu-item-logout]').click()
|
|
cy.location('pathname').should('include', '/login')
|
|
},
|
|
}
|