n8n/cypress/pages/modals/message-box.ts
Iván Ovejero af3ac2db28
refactor: Set up Cypress as pnpm workspace (no-changelog) (#6049)
Co-authored-by: कारतोफ्फेलस्क्रिप्ट™ <aditya@netroy.in>
2024-06-10 15:49:50 +02:00

21 lines
607 B
TypeScript

import { BasePage } from '../base';
export class MessageBox extends BasePage {
getters = {
modal: () => cy.get('.el-message-box', { withinSubject: null }),
header: () => this.getters.modal().find('.el-message-box__title'),
content: () => this.getters.modal().find('.el-message-box__content'),
confirm: () => this.getters.modal().find('.btn--confirm').first(),
cancel: () => this.getters.modal().find('.btn--cancel').first(),
};
actions = {
confirm: () => {
this.getters.confirm().click({ force: true });
},
cancel: () => {
this.getters.cancel().click({ force: true });
},
};
}