mirror of
https://github.com/n8n-io/n8n.git
synced 2025-02-21 02:56:40 -08:00
Some checks failed
Test Master / install-and-build (push) Waiting to run
Test Master / Unit tests (18.x) (push) Blocked by required conditions
Test Master / Unit tests (20.x) (push) Blocked by required conditions
Test Master / Unit tests (22.4) (push) Blocked by required conditions
Test Master / Lint (push) Blocked by required conditions
Test Master / Notify Slack on failure (push) Blocked by required conditions
Benchmark Docker Image CI / build (push) Has been cancelled
Co-authored-by: Danny Martini <danny@n8n.io>
25 lines
824 B
TypeScript
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 });
|
|
}
|
|
});
|
|
};
|