WIP: fix_js_e2e_test #1059

Closed
jsegarra wants to merge 4 commits from fix_js_e2e_test into test
5 changed files with 17 additions and 7 deletions

View File

@ -429,6 +429,7 @@ function handleSelection({ evt, added, rows: selectedRows }, rows) {
</template> </template>
<template #body="{ rows }"> <template #body="{ rows }">
<QTable <QTable
data-cy="vnTable"
ref="tableRef" ref="tableRef"
v-bind="table" v-bind="table"
class="vnTable" class="vnTable"

View File

@ -307,7 +307,7 @@ const openEditTableCellDialog = () => {
const onEditCellDataSaved = async () => { const onEditCellDataSaved = async () => {
rowsSelected.value = []; rowsSelected.value = [];
tableRef.value.reload(); tableRef.value.reload({});
}; };
const removeFuturePrice = async () => { const removeFuturePrice = async () => {
@ -324,7 +324,6 @@ function confirmRemove(item, isFuture) {
component: VnConfirm, component: VnConfirm,
componentProps: { componentProps: {
title: t('globals.rowWillBeRemoved'), title: t('globals.rowWillBeRemoved'),
message: t('globals.confirmDeletion'),
promise, promise,
}, },
}); });

View File

@ -265,7 +265,8 @@ async function autofillBic(worker) {
v-model="data.bossFk" v-model="data.bossFk"
url="Workers/search" url="Workers/search"
option-value="id" option-value="id"
option-label="name" :fields="['id', 'name', 'nickname', 'code']"
sort-by="nickname ASC"
hide-selected hide-selected
> >
<template #option="scope"> <template #option="scope">
@ -377,5 +378,6 @@ async function autofillBic(worker) {
<i18n> <i18n>
es: es:
Search worker: Buscar trabajador Search worker: Buscar trabajador
Create worker: Crear trabajador
You can search by worker id or name: Puedes buscar por id o nombre del trabajador You can search by worker id or name: Puedes buscar por id o nombre del trabajador
</i18n> </i18n>

View File

@ -48,7 +48,15 @@ describe('Handle Items FixedPrice', () => {
cy.get('#subToolbar > .q-btn--standard').click(); cy.get('#subToolbar > .q-btn--standard').click();
cy.selectOption("[data-cy='field-to-edit']", 'Min price'); cy.selectOption("[data-cy='field-to-edit']", 'Min price');
cy.dataCy('value-to-edit').find('input').type('1'); cy.dataCy('value-to-edit').find('input').type('1');
cy.get('.countLines').should('have.text', ' 1 ');
cy.get('.q-table__bottom > .q-table__control > div').then((row) => {
// Asegúrate de que rows sea un objeto iterable
const numRows = row.text().match(/(\d+)/);
const numSelectedRows = numRows ? parseInt(numRows[1], 10) : 0;
cy.log(`Número de filas: ${numSelectedRows}`);
// expect(numRows).to.be.greaterThan(0); // Ejemplo de aserción
cy.get('.countLines').should('have.text', ` ${numSelectedRows} `);
});
cy.get('.q-mt-lg > .q-btn--standard').click(); cy.get('.q-mt-lg > .q-btn--standard').click();
cy.get('.q-notification__message').should('have.text', 'Data saved'); cy.get('.q-notification__message').should('have.text', 'Data saved');
}); });

View File

@ -1,7 +1,7 @@
describe('WorkerCreate', () => { describe('WorkerCreate', () => {
const externalRadio = '.q-radio:nth-child(2)'; const externalRadio = '.q-radio:nth-child(2)';
const notification = '.q-notification__message'; const notification = '.q-notification__message';
const developerBossId = 120; const teamBossId = 13;
const payMethodCross = const payMethodCross =
'.grid-create .full-width > :nth-child(9) .q-select .q-field__append:not(.q-anchor--skip)'; '.grid-create .full-width > :nth-child(9) .q-select .q-field__append:not(.q-anchor--skip)';
const saveBtn = '.q-mt-lg > .q-btn--standard'; const saveBtn = '.q-mt-lg > .q-btn--standard';
@ -17,7 +17,7 @@ describe('WorkerCreate', () => {
Location: { val: 1, type: 'select' }, Location: { val: 1, type: 'select' },
Phone: { val: '123456789' }, Phone: { val: '123456789' },
'Worker code': { val: 'DWW' }, 'Worker code': { val: 'DWW' },
Boss: { val: developerBossId, type: 'select' }, Boss: { val: teamBossId, type: 'select' },
Birth: { val: '11-12-2022', type: 'date' }, Birth: { val: '11-12-2022', type: 'date' },
}; };
const external = { const external = {
@ -27,7 +27,7 @@ describe('WorkerCreate', () => {
'Last name': { val: 'GARCIA' }, 'Last name': { val: 'GARCIA' },
'Personal email': { val: 'pepe@gmail.com' }, 'Personal email': { val: 'pepe@gmail.com' },
'Worker code': { val: 'PG' }, 'Worker code': { val: 'PG' },
Boss: { val: developerBossId, type: 'select' }, Boss: { val: teamBossId, type: 'select' },
}; };
beforeEach(() => { beforeEach(() => {