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

26 lines
910 B
JavaScript

describe('WorkerList', () => {
const nif = '12091201A';
const searchButton = '.q-scrollarea__content > .q-btn--standard > .q-btn__content';
const url = '/#/worker/management';
it('should not enter the section', () => {
cy.login('salesPerson');
cy.visit(url);
cy.url().should('include', '/dashboard');
});
it('should enter the section and filter by NIF, then open the worker summary popup', () => {
cy.login('hr');
cy.visit(url);
cy.get('[label="NIF"] > .q-field > .q-field__inner > .q-field__control').type(
nif,
);
cy.get(searchButton).click();
cy.dataCy('tableAction-0').click();
cy.get('.summaryHeader').should('exist');
cy.get('.summaryHeader').should('be.visible');
cy.get('.summaryBody').should('exist');
cy.get('.summaryBody').should('be.visible');
});
});