mirror of
https://github.com/n8n-io/n8n.git
synced 2025-01-25 19:41:14 -08:00
23 lines
704 B
TypeScript
23 lines
704 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 buttons = successToast().find('.el-notification__closeBtn');
|
|
buttons.then(($buttons) => {
|
|
if ($buttons.length) {
|
|
buttons.click({ multiple: true });
|
|
}
|
|
});
|
|
};
|