0
1
Fork 0

Create confirmDialog command

This commit is contained in:
William Buezas 2024-10-24 14:21:49 -03:00
parent 40444ac46a
commit e4bc14ef3b
4 changed files with 8 additions and 6 deletions

View File

@ -16,8 +16,7 @@ describe('NewsView', () => {
.within(() => {
cy.dataCy('deleteNewBtn').click();
});
cy.dataCy('confirmDialogButton').should('exist');
cy.dataCy('confirmDialogButton').click();
cy.setConfirmDialog();
cy.dataCy('positiveNotify').should('contain', 'Datos guardados');
cy.dataCy('newsCard').should('have.length', 2);
});

View File

@ -12,8 +12,7 @@ describe('PendingOrders', () => {
cy.get('input[data-testid="payAmountInput"]').clear();
if (typeAmount || typeAmount === 0)
cy.get('input[data-testid="payAmountInput"]').type(typeAmount);
cy.dataCy('confirmDialogButton').should('exist');
cy.dataCy('confirmDialogButton').click();
cy.setConfirmDialog();
};
// it('confirm payment redirects to payment site', () => {

View File

@ -40,8 +40,7 @@ describe('PendingOrders', () => {
checkExistingOrder();
cy.dataCy('pendingOrderCard').should('have.length', 1);
cy.dataCy('pendingOrderCardDelete').click();
cy.dataCy('confirmDialogButton').should('exist');
cy.dataCy('confirmDialogButton').click();
cy.setConfirmDialog();
cy.dataCy('positiveNotify').should('contain', 'Datos guardados');
checkEmptyList();
});

View File

@ -82,3 +82,8 @@ Cypress.Commands.add('setSessionStorage', (key, value) => {
Cypress.Commands.add('resetDB', () => {
cy.exec('npm run resetDatabase');
});
Cypress.Commands.add('setConfirmDialog', () => {
cy.dataCy('confirmDialogButton').should('exist');
cy.dataCy('confirmDialogButton').click();
});