0
0
Fork 0
salix-front-mindshore-fork2/test/cypress/integration/agency/agencyWorkCenter.spec.js

51 lines
2.4 KiB
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');
cy.visit(`/#/agency`);
});
2024-04-25 10:34:19 +00:00
it('assign workCenter', () => {
2024-04-22 16:17:01 +00:00
cy.visit(`/#/agency`);
cy.get(':nth-child(1) > :nth-child(1) > .card-list-body > .list-items').click();
2024-04-25 10:34:19 +00:00
cy.get('[href="#/agency/11/workCenter"] > .q-item__section--main').click();
2024-04-22 16:17:01 +00:00
cy.get('.q-page-sticky > div > .q-btn > .q-btn__content > .q-icon').click();
2024-04-25 10:34:19 +00:00
cy.get(
'.vn-row > .q-field > .q-field__inner > .q-field__control > .q-field__control-container'
).type('workCenterOne{enter}');
2024-04-22 16:17:01 +00:00
cy.get('.q-btn--standard > .q-btn__content > .block').click();
2024-04-25 10:34:19 +00:00
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',
2024-04-25 15:17:28 +00:00
'WorkCenter removed successfully'
2024-04-25 10:34:19 +00:00
);
});
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();
2024-04-22 16:17:01 +00:00
cy.get('.q-page-sticky > div > .q-btn > .q-btn__content > .q-icon').click();
2024-04-25 10:34:19 +00:00
cy.get(
'.vn-row > .q-field > .q-field__inner > .q-field__control > .q-field__control-container'
).type('workCenterOne{enter}');
2024-04-22 16:17:01 +00:00
cy.get('.q-btn--standard > .q-btn__content > .block').click();
2024-04-25 10:34:19 +00:00
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('.q-btn--standard > .q-btn__content > .block').click();
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');
2024-04-22 16:17:01 +00:00
});
});