Files
n8n-enterprise-unlocked/cypress/pages/notifications.ts
Csaba Tuncsik 073b05b10c fix(editor): Fix workflow moving E2E tests (#13396)
Co-authored-by: Danny Martini <danny@n8n.io>
2025-02-20 16:35:15 +01:00

25 lines
824 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 = () => {
const notificationSelector = '.el-notification:has(.el-notification--success)';
cy.get('body').then(($body) => {
if ($body.find(notificationSelector).length) {
cy.get(notificationSelector)
.find('.el-notification__closeBtn')
.click({ multiple: true, force: true });
}
});
};