7525-devToTest #419

Merged
alexm merged 177 commits from 7525-devToTest into test 2024-06-04 08:06:27 +00:00
2 changed files with 18 additions and 20 deletions
Showing only changes of commit 1c76d86710 - Show all commits

View File

@ -2,8 +2,7 @@
describe('InvoiceInBasicData', () => {
const formInputs = '.q-form > .q-card input';
const firstFormSelect = '.q-card > .vn-row:nth-child(1) > .q-select';
const appendBtns = '.q-form label button';
const dialogAppendBtns = '.q-dialog label button';
const documentBtns = '.q-form .q-field button';
const dialogInputs = '.q-dialog input';
const dialogActionBtns = '.q-card__actions button';
@ -15,8 +14,7 @@ describe('InvoiceInBasicData', () => {
it('should edit the provideer and supplier ref', () => {
cy.selectOption(firstFormSelect, 'Bros');
cy.get('[title="Reset"]').click();
cy.get(appendBtns).eq(0).click();
cy.get(formInputs).eq(1).type(4739);
cy.get(formInputs).eq(1).type('{selectall}4739');
cy.saveCard();
cy.get(`${firstFormSelect} input`).invoke('val').should('eq', 'Plants nick');
@ -27,22 +25,20 @@ describe('InvoiceInBasicData', () => {
const firtsInput = 'Ticket:65';
const secondInput = "I don't know what posting here!";
cy.get(appendBtns).eq(3).click();
cy.get(dialogAppendBtns).eq(0).click();
cy.get(dialogInputs).eq(0).type(firtsInput);
cy.get(dialogAppendBtns).eq(1).click();
cy.get('textarea').type(secondInput);
cy.get(documentBtns).eq(1).click();
cy.get(dialogInputs).eq(0).type(`{selectall}${firtsInput}`);
cy.get('textarea').type(`{selectall}${secondInput}`);
cy.get(dialogActionBtns).eq(1).click();
cy.get(appendBtns).eq(3).click();
cy.get(documentBtns).eq(1).click();
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', () => {
cy.get(appendBtns).eq(2).click();
cy.get(appendBtns).eq(1).click();
cy.get(formInputs).eq(5).click();
cy.get(formInputs).eq(5).type('{selectall}{backspace}');
cy.get(documentBtns).eq(0).click();
cy.get(dialogActionBtns).eq(1).click();
cy.get('.q-notification__message').should(
'have.text',

View File

@ -1,7 +1,9 @@
describe('InvoiceInDescriptor', () => {
const saveDialog = '.q-btn--unelevated > .q-btn__content > .block';
const dialogBtns = '.q-card__actions button';
const firstDescritorOpt = '.q-menu > .q-list > :nth-child(1) > .q-item__section';
const screen = '.q-drawer-container > .fullscreen';
const isBookedField =
'.q-card:nth-child(3) .vn-label-value:nth-child(5) > .value > span';
it('should booking and unbooking the invoice properly', () => {
cy.login('developer');
cy.visit(`/#/invoice-in/1/summary?limit=10`);
@ -9,14 +11,14 @@ describe('InvoiceInDescriptor', () => {
cy.openLeftMenu();
cy.openActionsDescriptor();
cy.get(firstDescritorOpt).click();
cy.get(saveDialog).click();
cy.get(screen).click();
cy.get('.q-checkbox').should('have.attr', 'aria-checked', 'true');
cy.get(dialogBtns).eq(1).click();
cy.get('.fullscreen').first().click();
cy.get(isBookedField).should('have.attr', 'title', 'true');
cy.openLeftMenu();
cy.openActionsDescriptor();
cy.get(firstDescritorOpt).click();
cy.get(saveDialog).click();
cy.get('.q-checkbox').should('have.attr', 'aria-checked', 'false');
cy.get(dialogBtns).eq(1).click();
cy.get(isBookedField).should('have.attr', 'title', 'false');
});
});