0
0
Fork 0

fix: fixed basic data e2e

This commit is contained in:
Jon Elias 2025-02-10 10:20:40 +01:00
parent 0e1f04323c
commit 8c499e3fc3
1 changed files with 8 additions and 11 deletions

View File

@ -1,23 +1,20 @@
/// <reference types="cypress" />
describe('InvoiceInBasicData', () => {
const formInputs = '.q-form > .q-card input';
const firstFormSelect = '.q-card > .vn-row:nth-child(1) > .q-select';
const documentBtns = '[data-cy="dms-buttons"] button';
const documentBtns = '[data-cy="dms-buttons"]';
const dialogInputs = '.q-dialog input';
beforeEach(() => {
cy.login('developer');
cy.visit(`/#/invoice-in/1/basic-data`);
cy.visit(`/#/invoice-in/2/basic-data`);
});
it('should edit the provideer and supplier ref', () => {
cy.selectOption(firstFormSelect, 'Bros');
cy.selectOption('[data-cy="Undeductible VAT_select"]', '4751000000')
cy.get('[title="Reset"]').click();
cy.get(formInputs).eq(1).type('{selectall}4739');
cy.selectOption(firstFormSelect, 'Bros');
cy.saveCard();
cy.get(`${firstFormSelect} input`).invoke('val').should('eq', 'Plants nick');
cy.get(formInputs).eq(1).invoke('val').should('eq', '4739');
cy.get(`${firstFormSelect} input`).invoke('val').should('eq', 'Bros nick');
});
it('should edit, remove and create the dms data', () => {
@ -25,18 +22,18 @@ describe('InvoiceInBasicData', () => {
const secondInput = "I don't know what posting here!";
//edit
cy.get(documentBtns).eq(1).click();
cy.get(`${documentBtns} > :nth-child(2)`).click();
cy.get(dialogInputs).eq(0).type(`{selectall}${firtsInput}`);
cy.get('textarea').type(`{selectall}${secondInput}`);
cy.get('[data-cy="FormModelPopup_save"]').click();
cy.get(documentBtns).eq(1).click();
cy.get(`${documentBtns} > :nth-child(2)`).click();
cy.get(dialogInputs).eq(0).invoke('val').should('eq', firtsInput);
cy.get('textarea').invoke('val').should('eq', secondInput);
cy.get('[data-cy="FormModelPopup_save"]').click();
cy.checkNotification('Data saved');
//remove
cy.get(documentBtns).eq(2).click();
cy.get(`${documentBtns} > :nth-child(3)`).click();
cy.get('[data-cy="VnConfirm_confirm"]').click();
cy.checkNotification('Data saved');