forked from verdnatura/salix-front
fix: refs #6942 e2e tests
This commit is contained in:
parent
12016f8653
commit
1c76d86710
|
@ -2,8 +2,7 @@
|
||||||
describe('InvoiceInBasicData', () => {
|
describe('InvoiceInBasicData', () => {
|
||||||
const formInputs = '.q-form > .q-card input';
|
const formInputs = '.q-form > .q-card input';
|
||||||
const firstFormSelect = '.q-card > .vn-row:nth-child(1) > .q-select';
|
const firstFormSelect = '.q-card > .vn-row:nth-child(1) > .q-select';
|
||||||
const appendBtns = '.q-form label button';
|
const documentBtns = '.q-form .q-field button';
|
||||||
const dialogAppendBtns = '.q-dialog label button';
|
|
||||||
const dialogInputs = '.q-dialog input';
|
const dialogInputs = '.q-dialog input';
|
||||||
const dialogActionBtns = '.q-card__actions button';
|
const dialogActionBtns = '.q-card__actions button';
|
||||||
|
|
||||||
|
@ -15,8 +14,7 @@ describe('InvoiceInBasicData', () => {
|
||||||
it('should edit the provideer and supplier ref', () => {
|
it('should edit the provideer and supplier ref', () => {
|
||||||
cy.selectOption(firstFormSelect, 'Bros');
|
cy.selectOption(firstFormSelect, 'Bros');
|
||||||
cy.get('[title="Reset"]').click();
|
cy.get('[title="Reset"]').click();
|
||||||
cy.get(appendBtns).eq(0).click();
|
cy.get(formInputs).eq(1).type('{selectall}4739');
|
||||||
cy.get(formInputs).eq(1).type(4739);
|
|
||||||
cy.saveCard();
|
cy.saveCard();
|
||||||
|
|
||||||
cy.get(`${firstFormSelect} input`).invoke('val').should('eq', 'Plants nick');
|
cy.get(`${firstFormSelect} input`).invoke('val').should('eq', 'Plants nick');
|
||||||
|
@ -27,22 +25,20 @@ describe('InvoiceInBasicData', () => {
|
||||||
const firtsInput = 'Ticket:65';
|
const firtsInput = 'Ticket:65';
|
||||||
const secondInput = "I don't know what posting here!";
|
const secondInput = "I don't know what posting here!";
|
||||||
|
|
||||||
cy.get(appendBtns).eq(3).click();
|
cy.get(documentBtns).eq(1).click();
|
||||||
cy.get(dialogAppendBtns).eq(0).click();
|
cy.get(dialogInputs).eq(0).type(`{selectall}${firtsInput}`);
|
||||||
cy.get(dialogInputs).eq(0).type(firtsInput);
|
cy.get('textarea').type(`{selectall}${secondInput}`);
|
||||||
cy.get(dialogAppendBtns).eq(1).click();
|
|
||||||
cy.get('textarea').type(secondInput);
|
|
||||||
cy.get(dialogActionBtns).eq(1).click();
|
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(dialogInputs).eq(0).invoke('val').should('eq', firtsInput);
|
||||||
cy.get('textarea').invoke('val').should('eq', secondInput);
|
cy.get('textarea').invoke('val').should('eq', secondInput);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should throw an error creating a new dms if a file is not attached', () => {
|
it('should throw an error creating a new dms if a file is not attached', () => {
|
||||||
cy.get(appendBtns).eq(2).click();
|
cy.get(formInputs).eq(5).click();
|
||||||
cy.get(appendBtns).eq(1).click();
|
cy.get(formInputs).eq(5).type('{selectall}{backspace}');
|
||||||
|
cy.get(documentBtns).eq(0).click();
|
||||||
cy.get(dialogActionBtns).eq(1).click();
|
cy.get(dialogActionBtns).eq(1).click();
|
||||||
cy.get('.q-notification__message').should(
|
cy.get('.q-notification__message').should(
|
||||||
'have.text',
|
'have.text',
|
||||||
|
|
|
@ -1,7 +1,9 @@
|
||||||
describe('InvoiceInDescriptor', () => {
|
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 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', () => {
|
it('should booking and unbooking the invoice properly', () => {
|
||||||
cy.login('developer');
|
cy.login('developer');
|
||||||
cy.visit(`/#/invoice-in/1/summary?limit=10`);
|
cy.visit(`/#/invoice-in/1/summary?limit=10`);
|
||||||
|
@ -9,14 +11,14 @@ describe('InvoiceInDescriptor', () => {
|
||||||
cy.openLeftMenu();
|
cy.openLeftMenu();
|
||||||
cy.openActionsDescriptor();
|
cy.openActionsDescriptor();
|
||||||
cy.get(firstDescritorOpt).click();
|
cy.get(firstDescritorOpt).click();
|
||||||
cy.get(saveDialog).click();
|
cy.get(dialogBtns).eq(1).click();
|
||||||
cy.get(screen).click();
|
cy.get('.fullscreen').first().click();
|
||||||
cy.get('.q-checkbox').should('have.attr', 'aria-checked', 'true');
|
cy.get(isBookedField).should('have.attr', 'title', 'true');
|
||||||
|
|
||||||
cy.openLeftMenu();
|
cy.openLeftMenu();
|
||||||
cy.openActionsDescriptor();
|
cy.openActionsDescriptor();
|
||||||
cy.get(firstDescritorOpt).click();
|
cy.get(firstDescritorOpt).click();
|
||||||
cy.get(saveDialog).click();
|
cy.get(dialogBtns).eq(1).click();
|
||||||
cy.get('.q-checkbox').should('have.attr', 'aria-checked', 'false');
|
cy.get(isBookedField).should('have.attr', 'title', 'false');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue