salix-front/test/cypress/integration/route/agency/agencyWorkCenter.spec.js

27 lines
993 B
JavaScript
Raw Normal View History

2024-04-25 10:40:17 +00:00
describe('AgencyWorkCenter', () => {
2024-04-22 16:17:01 +00:00
beforeEach(() => {
cy.viewport(1920, 1080);
cy.login('developer');
2024-07-01 07:18:16 +00:00
cy.visit(`/#/agency/11/workCenter`);
2024-04-22 16:17:01 +00:00
});
2024-10-04 11:13:57 +00:00
const createButton = '.q-page-sticky > div > .q-btn > .q-btn__content > .q-icon';
const workCenterCombobox = 'input[role="combobox"]';
2024-04-22 16:17:01 +00:00
it('check workCenter crud', () => {
// create
2024-10-04 11:13:57 +00:00
cy.get(createButton).click();
cy.get(workCenterCombobox).type('workCenterOne{enter}');
2024-10-25 08:53:19 +00:00
cy.checkNotification('Data created');
2024-04-25 10:34:19 +00:00
// expect error when duplicate
2024-10-04 11:13:57 +00:00
cy.get(createButton).click();
cy.get('[data-cy="FormModelPopup_save"]').click();
2024-10-25 08:33:59 +00:00
cy.checkNotification('This workCenter is already assigned to this agency');
cy.get('[data-cy="FormModelPopup_cancel"]').click();
2024-04-25 10:34:19 +00:00
// delete
cy.get('.q-item__section--side > .q-btn > .q-btn__content > .q-icon').click();
2024-10-25 08:33:59 +00:00
cy.checkNotification('WorkCenter removed successfully');
2024-04-22 16:17:01 +00:00
});
});