35 lines
1.2 KiB
JavaScript
35 lines
1.2 KiB
JavaScript
describe('AgencyWorkCenter', () => {
|
|
const selectors = {
|
|
workCenter: 'workCenter_select',
|
|
popupSave: 'FormModelPopup_save',
|
|
popupCancel: 'FormModelPopup_cancel',
|
|
remove: 'removeWorkCenterBtn',
|
|
};
|
|
|
|
const messages = {
|
|
dataCreated: 'Data created',
|
|
alreadyAssigned: 'This workCenter is already assigned to this agency',
|
|
removed: 'Work center removed successfully',
|
|
};
|
|
|
|
beforeEach(() => {
|
|
cy.viewport(1920, 1080);
|
|
cy.login('developer');
|
|
cy.visit(`/#/route/agency/11/workCenter`);
|
|
});
|
|
|
|
it('Should add work center, check already assigned and remove work center', () => {
|
|
cy.addBtnClick();
|
|
cy.selectOption('[data-cy="workCenter_select"]', 'workCenterOne');
|
|
cy.dataCy(selectors.popupSave).click();
|
|
cy.checkNotification('Data created');
|
|
cy.addBtnClick();
|
|
cy.selectOption('[data-cy="workCenter_select"]', 'workCenterOne');
|
|
cy.dataCy(selectors.popupSave).click();
|
|
cy.checkNotification(messages.alreadyAssigned);
|
|
cy.dataCy(selectors.popupCancel).click();
|
|
cy.dataCy(selectors.remove).click();
|
|
cy.checkNotification(messages.removed);
|
|
});
|
|
});
|