Fix[InvoiceInBasicData]: fixed basic data e2e #1361

Merged
jon merged 6 commits from Fix-InvoiceInBasicDataE2E into dev 2025-02-11 07:14:50 +00:00
2 changed files with 13 additions and 8 deletions
Showing only changes of commit aa6c6f0e69 - Show all commits

View File

@ -121,6 +121,7 @@ function deleteFile(dmsFk) {
hide-selected
:is-clearable="false"
:required="true"
data-cy="vnSupplierSelect"
/>
<VnInput
clearable
@ -149,6 +150,7 @@ function deleteFile(dmsFk) {
option-value="id"
option-label="id"
:filter-options="['id', 'name']"
data-cy="UnDeductibleVatSelect"
>
<template #option="scope">
<QItem v-bind="scope.itemProps">

View File

@ -1,18 +1,21 @@
/// <reference types="cypress" />
describe('InvoiceInBasicData', () => {
const firstFormSelect = '.q-card > .vn-row:nth-child(1) > .q-select';
const documentBtns = '[data-cy="dms-buttons"]';
const dialogInputs = '.q-dialog input';
jon marked this conversation as resolved Outdated

le sigue un child, correcto?
Porque no lo haces función?

le sigue un child, correcto? Porque no lo haces función?
const resetBtn = '.q-btn-group--push > .q-btn--flat';
const getDocumentBtns = (opt) => `[data-cy="dms-buttons"] > :nth-child(${opt})`;
beforeEach(() => {
cy.login('developer');
cy.visit(`/#/invoice-in/2/basic-data`);
cy.visit(`/#/invoice-in/1/basic-data`);
});
it('should edit the provideer and supplier ref', () => {
jon marked this conversation as resolved Outdated

podemos hacer el evitar este selectOption? en favor de una "funcion/logica" manual?

podemos hacer el evitar este selectOption? en favor de una "funcion/logica" manual?
cy.selectOption('[data-cy="Undeductible VAT_select"]', '4751000000')
cy.get('[title="Reset"]').click();
cy.selectOption(firstFormSelect, 'Bros');
cy.dataCy('UnDeductibleVatSelect').type('4751000000');
cy.get('.q-menu .q-item').contains('4751000000').click();
cy.get(resetBtn).click();
cy.dataCy('vnSupplierSelect').type('Bros nick');
cy.get('.q-menu .q-item').contains('Bros nick').click();
cy.saveCard();
cy.get(`${firstFormSelect} input`).invoke('val').should('eq', 'Bros nick');
});
@ -22,18 +25,18 @@ describe('InvoiceInBasicData', () => {
const secondInput = "I don't know what posting here!";
//edit
cy.get(`${documentBtns} > :nth-child(2)`).click();
cy.get(getDocumentBtns(2)).click();
jon marked this conversation as resolved Outdated

Lo pongo como comentario, pero ya que estamos, podemos quitar el cy.get(data-cy) y usar cy.dataCy

Lo pongo como comentario, pero ya que estamos, podemos quitar el cy.get(data-cy) y usar cy.dataCy
cy.get(dialogInputs).eq(0).type(`{selectall}${firtsInput}`);
cy.get('textarea').type(`{selectall}${secondInput}`);
cy.get('[data-cy="FormModelPopup_save"]').click();
cy.get(`${documentBtns} > :nth-child(2)`).click();
cy.get(getDocumentBtns(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} > :nth-child(3)`).click();
cy.get(getDocumentBtns(3)).click();
cy.get('[data-cy="VnConfirm_confirm"]').click();
cy.checkNotification('Data saved');