2022-12-15 07:39:59 -08:00
|
|
|
import { BasePage } from '../base';
|
2022-11-24 03:52:09 -08:00
|
|
|
|
2025-01-08 00:36:44 -08:00
|
|
|
/**
|
|
|
|
* @deprecated Use functional composables from @composables instead.
|
|
|
|
* If a composable doesn't exist for your use case, please create a new one in:
|
|
|
|
* cypress/composables
|
|
|
|
*
|
|
|
|
* This class-based approach is being phased out in favor of more modular functional composables.
|
|
|
|
* Each getter and action in this class should be moved to individual composable functions.
|
|
|
|
*/
|
2022-11-24 03:52:09 -08:00
|
|
|
export class MessageBox extends BasePage {
|
|
|
|
getters = {
|
|
|
|
modal: () => cy.get('.el-message-box', { withinSubject: null }),
|
|
|
|
header: () => this.getters.modal().find('.el-message-box__title'),
|
2022-11-24 14:22:09 -08:00
|
|
|
content: () => this.getters.modal().find('.el-message-box__content'),
|
2023-07-28 00:51:07 -07:00
|
|
|
confirm: () => this.getters.modal().find('.btn--confirm').first(),
|
|
|
|
cancel: () => this.getters.modal().find('.btn--cancel').first(),
|
2022-11-24 03:52:09 -08:00
|
|
|
};
|
2024-06-10 06:49:50 -07:00
|
|
|
|
2022-11-24 03:52:09 -08:00
|
|
|
actions = {
|
|
|
|
confirm: () => {
|
2023-08-16 08:13:57 -07:00
|
|
|
this.getters.confirm().click({ force: true });
|
2022-11-24 03:52:09 -08:00
|
|
|
},
|
|
|
|
cancel: () => {
|
2023-08-16 08:13:57 -07:00
|
|
|
this.getters.cancel().click({ force: true });
|
2022-11-24 03:52:09 -08:00
|
|
|
},
|
|
|
|
};
|
|
|
|
}
|