salix-front/test/cypress/integration/worker/workerPda.spec.js

83 lines
3.6 KiB
JavaScript

describe('WorkerPda', () => {
const deviceProductionField =
'.vn-row > .q-field > .q-field__inner > .q-field__control > .q-field__control-container';
beforeEach(() => {
cy.viewport(1920, 1080);
cy.login('developer');
cy.visit(`/#/worker/1110/pda`);
cy.waitForElement('.q-page');
});
it('assign pda', () => {
cy.get('.q-page-sticky > div > .q-btn > .q-btn__content > .q-icon').click();
cy.get(deviceProductionField).type('{downArrow}{enter}');
cy.get('.vn-row > #simSerialNumber').type('123{enter}');
cy.get('.q-notification__message').should('have.text', 'Data created');
});
describe(' Row Actions', () => {
describe(' Docuware Flow ', () => {
describe(' NOT Signed ', () => {
beforeEach(() => {
cy.intercept('POST', '**/checkFile', 'false').as('not_signed');
});
it('docuware', () => {
// Btn icon-client is present
cy.get(
':nth-child(1) > .vn-row > :nth-child(6) > .q-btn__content > .q-icon'
).should('have.class', 'icon-client');
// Btn icon-client is clicked
cy.get(
':nth-child(1) > .vn-row > :nth-child(6) > .q-btn__content > .q-icon'
).click();
// Btn confirm is clicked
cy.get(
'.q-card__actions > .q-btn--unelevated > .q-btn__content > .block'
).click();
// Btn refresh is present
cy.get(
':nth-child(1) > .vn-row > :nth-child(6) > .q-btn__content > .q-icon'
).should('have.text', 'refresh');
// Btn refresh is clicked
cy.get(
':nth-child(1) > .vn-row > :nth-child(6) > .q-btn__content > .q-icon'
).click();
// Btn cloud_download is present
cy.get(
':nth-child(1) > .vn-row > :nth-child(6) > .q-btn__content > .q-icon'
).should('have.text', 'cloud_download');
// Btn cloud_download is clicked
cy.get(
':nth-child(1) > .vn-row > :nth-child(6) > .q-btn__content > .q-icon'
).click();
});
});
describe(' Is Signed ', () => {
beforeEach(() => {
cy.intercept('POST', '**/checkFile', { id: 1 }).as('not_docuware');
});
it('docuware', () => {
// Btn cloud_download is present
cy.get(
':nth-child(1) > .vn-row > :nth-child(6) > .q-btn__content > .q-icon'
).should('have.text', 'cloud_download');
// Btn cloud_download is clicked
cy.get(
':nth-child(1) > .vn-row > :nth-child(6) > .q-btn__content > .q-icon'
).click();
});
});
});
describe(' Other actions ', () => {
it('delete pda', () => {
cy.get(
':nth-child(1) > .vn-row > :nth-child(5) > .q-btn__content > .q-icon'
).click();
cy.get(
'.q-card__actions > .q-btn--unelevated > .q-btn__content > .block'
).click();
cy.get('.q-notification__message').should('have.text', 'PDA deallocated');
});
});
});
});