diff --git a/addons/beyond_attendance_qr/views/hr_employee_views.xml b/addons/beyond_attendance_qr/views/hr_employee_views.xml index ee5f2eb..3572ec6 100644 --- a/addons/beyond_attendance_qr/views/hr_employee_views.xml +++ b/addons/beyond_attendance_qr/views/hr_employee_views.xml @@ -92,7 +92,10 @@
- +
{ +""" + AYUDANTES + ENTRAR + """ + // La fila de EQUIPO, no la primera clicable del tablero: la + // tabla de sucursales va antes y su clic filtra, no navega. + // Se ancla por el encabezado que solo tiene la de Equipo. + await hasta('.beyond_fila.beyond_clicable'); + const cabecera = [...document.querySelectorAll('.beyond_tabla_encabezado')] + .find(h => h.textContent.includes('Ventas atribuidas')); + if (!cabecera) throw new Error('no está la tabla de Equipo en el tablero'); + const fila = cabecera.parentElement.querySelector('.beyond_fila.beyond_clicable'); + if (!fila) throw new Error('la tabla de Equipo no tiene filas con ficha detrás'); + fila.click(); + let ficha = null; + for (let i = 0; i < 48 && !ficha; i++) { + await esperar(250); + ficha = document.querySelector('.o_beyond_persona_form'); + } + if (!ficha) { + // Decir DÓNDE se aterrizó vale más que «no apareció». + const vistas = ['.o_form_view', '.o_list_view', '.o_beyond_equipo', + '.o_beyond_tablero', '.o_kanban_view'] + .filter(s => document.querySelector(s)).join(' '); + throw new Error('tras tocar la fila no se abrió la ficha propia; ruta ' + + location.pathname + ' · vistas: ' + (vistas || 'ninguna') + + ' · título: ' + document.title); + } + await hasta('.beyond_pastilla_si_no .o_selection_badge'); + await esperar(800); + const pastillas = [...document.querySelectorAll('.beyond_pastilla_si_no .o_selection_badge')]; + if (pastillas.length !== 2) { + throw new Error('vacaciones trae ' + pastillas.length + ' pastillas'); + } + for (const p of pastillas) { + const c = p.getBoundingClientRect(); + if (c.height < 32 || c.width < 40) { + throw new Error('la pastilla «' + p.textContent.trim() + '» mide ' + + Math.round(c.width) + 'x' + Math.round(c.height)); + } + } + if (pastillas.filter(p => p.classList.contains('active')).length !== 1) { + throw new Error('el estado de vacaciones no se lee: ninguna o varias marcadas'); + } + pastillas[0].scrollIntoView({ block: 'center' }); + await esperar(400); + seVe('.beyond_pastilla_si_no .o_selection_badge', 'la primera pastilla de vacaciones'); + console.log('test successful'); + })(); + """, "", login='direccion@beyond.example', timeout=240) + + @tagged('post_install', '-at_install') class TestTableroA600(HttpCase): """El piso de ancho, no el diseño de teléfono.