busy-soccer-31234
03/08/2023, 5:22 PMts
let id;
it('create_category', () => {
cy.login();
cy.visit('/backoffice/communication/category/create');
cy.get('.ng-tns-c22-15 > .ant-form-item-control > .ant-form-item-children > .ant-input').clear();
cy.get('.ng-tns-c22-15 > .ant-form-item-control > .ant-form-item-children > .ant-input').type('teste');
cy.get('.ng-tns-c22-4 > .ant-form-item-control > .ant-form-item-children > .ant-input').clear();
cy.get('.ng-tns-c22-4 > .ant-form-item-control > .ant-form-item-children > .ant-input').type('12');
cy.get('.ant-switch').click();
cy.intercept('POST', '/api/communication/categories').as('createCategory');
cy.get('.button-submit').click();
cy.wait('@createCategory').then((interception) => {
id = interception.response.body.data[0].id
console.log(id)
expect(interception.response.statusCode).to.eq(200)
});
})
it('delete_category', () => {
cy.login();
cy.visit('/backoffice/communication/category/list');
cy.intercept('DELETE', '/backoffice/communication/categories/' + id).as('deleteCategory');
cy.get(':nth-child(1) > .text-right > .options_button').click();
cy.get('.ant-dropdown-menu > :nth-child(2)').click();
cy.get('.ant-btn-danger').click();
cy.wait('@deleteCategory').then((interception) => {
expect(interception.response.statusCode).to.eq(200)
});
}) I try this...gray-kilobyte-89541
03/08/2023, 5:58 PMbusy-soccer-31234
03/08/2023, 6:05 PMbusy-soccer-31234
03/08/2023, 6:06 PMbusy-soccer-31234
03/08/2023, 6:06 PMgray-kilobyte-89541
03/08/2023, 8:13 PMbusy-soccer-31234
03/08/2023, 10:26 PMbusy-soccer-31234
03/08/2023, 10:27 PM