salix-front/test/cypress/integration/invoiceIn/invoiceInBasicData.spec.js

49 lines
1.8 KiB
JavaScript
Raw Normal View History

2023-11-09 09:29:28 +00:00
/// <reference types="cypress" />
describe('InvoiceInBasicData', () => {
const formInputs = '.q-form > .q-card input';
const firstFormSelect = '.q-card > .vn-row:nth-child(1) > .q-select';
2024-05-24 07:56:16 +00:00
const documentBtns = '.q-form .q-field button';
2023-11-09 09:29:28 +00:00
const dialogInputs = '.q-dialog input';
const dialogActionBtns = '.q-card__actions button';
beforeEach(() => {
cy.login('developer');
cy.visit(`/#/invoice-in/1/basic-data`);
});
it('should edit the provideer and supplier ref', () => {
cy.selectOption(firstFormSelect, 'Bros');
2024-01-29 12:54:41 +00:00
cy.get('[title="Reset"]').click();
2024-05-24 07:56:16 +00:00
cy.get(formInputs).eq(1).type('{selectall}4739');
2023-11-09 09:29:28 +00:00
cy.saveCard();
cy.get(`${firstFormSelect} input`).invoke('val').should('eq', 'Plants nick');
cy.get(formInputs).eq(1).invoke('val').should('eq', '4739');
2023-11-09 09:29:28 +00:00
});
it('should edit the dms data', () => {
const firtsInput = 'Ticket:65';
const secondInput = "I don't know what posting here!";
2024-05-24 07:56:16 +00:00
cy.get(documentBtns).eq(1).click();
cy.get(dialogInputs).eq(0).type(`{selectall}${firtsInput}`);
cy.get('textarea').type(`{selectall}${secondInput}`);
2023-11-09 09:29:28 +00:00
cy.get(dialogActionBtns).eq(1).click();
2024-05-24 07:56:16 +00:00
cy.get(documentBtns).eq(1).click();
2023-11-09 09:29:28 +00:00
cy.get(dialogInputs).eq(0).invoke('val').should('eq', firtsInput);
cy.get('textarea').invoke('val').should('eq', secondInput);
});
it('should throw an error creating a new dms if a file is not attached', () => {
2024-05-24 07:56:16 +00:00
cy.get(formInputs).eq(5).click();
cy.get(formInputs).eq(5).type('{selectall}{backspace}');
cy.get(documentBtns).eq(0).click();
2023-11-09 09:29:28 +00:00
cy.get(dialogActionBtns).eq(1).click();
cy.get('.q-notification__message').should(
'have.text',
"The files can't be empty"
);
});
});