forked from verdnatura/salix-front
48 lines
2.2 KiB
JavaScript
48 lines
2.2 KiB
JavaScript
describe('AgencyWorkCenter', () => {
|
|
beforeEach(() => {
|
|
cy.viewport(1920, 1080);
|
|
cy.login('developer');
|
|
cy.visit(`/#/agency`);
|
|
});
|
|
|
|
it('assign workCenter', () => {
|
|
cy.visit(`/#/agency`);
|
|
cy.get(':nth-child(1) > :nth-child(1) > .card-list-body > .list-items').click();
|
|
cy.get('[href="#/agency/11/workCenter"] > .q-item__section--main').click();
|
|
cy.get('.q-page-sticky > div > .q-btn > .q-btn__content > .q-icon').click();
|
|
cy.get(
|
|
'.vn-row > .q-field > .q-field__inner > .q-field__control > .q-field__control-container'
|
|
).type('workCenterOne{enter}');
|
|
cy.get('.q-notification__message').should('have.text', 'Data created');
|
|
});
|
|
|
|
it('delete workCenter', () => {
|
|
cy.get(':nth-child(1) > :nth-child(1) > .card-list-body > .list-items').click();
|
|
cy.get('[href="#/agency/11/workCenter"] > .q-item__section--main').click();
|
|
cy.get('.q-item__section--side > .q-btn > .q-btn__content > .q-icon').click();
|
|
cy.get('.q-notification__message').should(
|
|
'have.text',
|
|
'WorkCenter removed successfully'
|
|
);
|
|
});
|
|
|
|
it('error on duplicate workCenter', () => {
|
|
cy.visit(`/#/agency`);
|
|
cy.get(':nth-child(1) > :nth-child(1) > .card-list-body > .list-items').click();
|
|
cy.get('[href="#/agency/11/workCenter"] > .q-item__section--main').click();
|
|
cy.get('.q-page-sticky > div > .q-btn > .q-btn__content > .q-icon').click();
|
|
cy.get(
|
|
'.vn-row > .q-field > .q-field__inner > .q-field__control > .q-field__control-container'
|
|
).type('workCenterOne{enter}');
|
|
cy.get('.q-notification__message').should('have.text', 'Data created');
|
|
cy.get('.q-page-sticky > div > .q-btn > .q-btn__content > .q-icon').click();
|
|
cy.get(
|
|
'.vn-row > .q-field > .q-field__inner > .q-field__control > .q-field__control-container'
|
|
).type('workCenterOne{enter}');
|
|
|
|
cy.get(
|
|
':nth-child(2) > .q-notification__wrapper > .q-notification__content > .q-notification__message'
|
|
).should('have.text', 'This workCenter is already assigned to this agency');
|
|
});
|
|
});
|