n8n/cypress/pages/notifications.ts
Mutasem Aldmour 50bd5b9080
feat: Update NPS Value Survey (#9638)
Co-authored-by: कारतोफ्फेलस्क्रिप्ट™ <aditya@netroy.in>
Co-authored-by: Tomi Turtiainen <10324676+tomi@users.noreply.github.com>
2024-06-11 10:23:30 +02:00

18 lines
612 B
TypeScript

type CyGetOptions = Parameters<(typeof cy)['get']>[1];
/**
* Getters
*/
export const successToast = () => cy.get('.el-notification:has(.el-notification--success)');
export const warningToast = () => cy.get('.el-notification:has(.el-notification--warning)');
export const errorToast = (options?: CyGetOptions) =>
cy.get('.el-notification:has(.el-notification--error)', options);
export const infoToast = () => cy.get('.el-notification:has(.el-notification--info)');
/**
* Actions
*/
export const clearNotifications = () => {
successToast().find('.el-notification__closeBtn').click({ multiple: true });
};