F1e: complete-child case finds the child by search and reads hidden marks as attached
This commit is contained in:
+19
-12
@@ -96,7 +96,7 @@ test('tea indicators: every tab loads, and the follow-up list exports to Excel',
|
|||||||
|
|
||||||
test('tea complete child: every screen has data', async ({ page }) => {
|
test('tea complete child: every screen has data', async ({ page }) => {
|
||||||
const problems = watch(page);
|
const problems = watch(page);
|
||||||
const recordNumber = 'N-0011';
|
const recordNumber = /^N-?0011$/;
|
||||||
const filled = /^\s*(?!—\s*$)\S/;
|
const filled = /^\s*(?!—\s*$)\S/;
|
||||||
const mark = '.point, .slice path, .sankey-node, .box';
|
const mark = '.point, .slice path, .sankey-node, .box';
|
||||||
const tab = (name: string) => page.getByRole('tab', { name }).click();
|
const tab = (name: string) => page.getByRole('tab', { name }).click();
|
||||||
@@ -104,12 +104,17 @@ test('tea complete child: every screen has data', async ({ page }) => {
|
|||||||
page.locator('app-tea-section').filter({
|
page.locator('app-tea-section').filter({
|
||||||
has: page.locator('mat-card-title').getByText(title, { exact: true }),
|
has: page.locator('mat-card-title').getByText(title, { exact: true }),
|
||||||
});
|
});
|
||||||
|
const find = async (host: string) => {
|
||||||
|
const search = page.locator(host).getByRole('searchbox', { name: 'Buscar paciente' });
|
||||||
|
await search.fill('N0011');
|
||||||
|
await search.press('Enter');
|
||||||
|
};
|
||||||
const childRow = (table: string) =>
|
const childRow = (table: string) =>
|
||||||
page
|
page
|
||||||
.locator(table)
|
.locator(table)
|
||||||
.getByRole('row')
|
.getByRole('row')
|
||||||
.filter({
|
.filter({
|
||||||
has: page.getByRole('cell', { name: recordNumber, exact: true }),
|
has: page.getByRole('cell', { name: recordNumber }),
|
||||||
});
|
});
|
||||||
|
|
||||||
await page.goto('/indicadores/tea');
|
await page.goto('/indicadores/tea');
|
||||||
@@ -136,6 +141,7 @@ test('tea complete child: every screen has data', async ({ page }) => {
|
|||||||
await expect(history.getByText('Sin datos para el periodo.')).toHaveCount(0);
|
await expect(history.getByText('Sin datos para el periodo.')).toHaveCount(0);
|
||||||
|
|
||||||
await tab('Seguimiento');
|
await tab('Seguimiento');
|
||||||
|
await find('app-tab-seguimiento-tea');
|
||||||
const followUp = childRow('app-tab-seguimiento-tea table.worklist');
|
const followUp = childRow('app-tab-seguimiento-tea table.worklist');
|
||||||
await expect(followUp.getByRole('cell')).toHaveCount(9);
|
await expect(followUp.getByRole('cell')).toHaveCount(9);
|
||||||
await expect(followUp.locator('td:not(:nth-child(5))')).toHaveText(Array(8).fill(filled));
|
await expect(followUp.locator('td:not(:nth-child(5))')).toHaveText(Array(8).fill(filled));
|
||||||
@@ -144,6 +150,7 @@ test('tea complete child: every screen has data', async ({ page }) => {
|
|||||||
|
|
||||||
await tab('Análisis de riesgo');
|
await tab('Análisis de riesgo');
|
||||||
const risk = page.locator('app-tab-riesgos-tea');
|
const risk = page.locator('app-tab-riesgos-tea');
|
||||||
|
await find('app-tab-riesgos-tea');
|
||||||
await risk.getByRole('combobox', { name: 'Modelo de asociación' }).click();
|
await risk.getByRole('combobox', { name: 'Modelo de asociación' }).click();
|
||||||
await page.getByRole('option', { name: 'Con resultados' }).click();
|
await page.getByRole('option', { name: 'Con resultados' }).click();
|
||||||
const riskRow = childRow('app-tab-riesgos-tea table.worklist');
|
const riskRow = childRow('app-tab-riesgos-tea table.worklist');
|
||||||
@@ -157,9 +164,9 @@ test('tea complete child: every screen has data', async ({ page }) => {
|
|||||||
|
|
||||||
await tab('Seguimiento');
|
await tab('Seguimiento');
|
||||||
await followUp.getByRole('link').click();
|
await followUp.getByRole('link').click();
|
||||||
await expect(page.getByText(recordNumber, { exact: true })).toBeVisible();
|
await expect(page.getByText(recordNumber)).toBeVisible();
|
||||||
const gantt = section('Línea del tiempo');
|
const gantt = section('Línea del tiempo');
|
||||||
await expect(gantt.locator('app-plot .barlayer .point').first()).toBeVisible();
|
await expect(gantt.locator('app-plot .barlayer .point').first()).toBeAttached();
|
||||||
const diamonds = gantt.locator('app-plot .scatterlayer path.point');
|
const diamonds = gantt.locator('app-plot .scatterlayer path.point');
|
||||||
await expect(diamonds).toHaveCount(4);
|
await expect(diamonds).toHaveCount(4);
|
||||||
for (const diamond of await diamonds.all()) {
|
for (const diamond of await diamonds.all()) {
|
||||||
@@ -172,10 +179,10 @@ test('tea complete child: every screen has data', async ({ page }) => {
|
|||||||
const alterations = section('Alteraciones');
|
const alterations = section('Alteraciones');
|
||||||
await expect(
|
await expect(
|
||||||
alterations.locator('h3:text-is("Norma por edad · p5–p95") + app-plot .point').first(),
|
alterations.locator('h3:text-is("Norma por edad · p5–p95") + app-plot .point').first(),
|
||||||
).toBeVisible();
|
).toBeAttached();
|
||||||
await expect(
|
await expect(
|
||||||
alterations.locator('h3:text-is("Mapa de la cabeza") + app-plot .contourlayer path').first(),
|
alterations.locator('h3:text-is("Mapa de la cabeza") + app-plot .contourlayer path').first(),
|
||||||
).toBeVisible();
|
).toBeAttached();
|
||||||
await expect(section('Relación con el ADOS-2').locator('tbody tr').first()).toBeVisible();
|
await expect(section('Relación con el ADOS-2').locator('tbody tr').first()).toBeVisible();
|
||||||
|
|
||||||
await page.getByRole('link', { name: 'Análisis de riesgo' }).click();
|
await page.getByRole('link', { name: 'Análisis de riesgo' }).click();
|
||||||
@@ -183,18 +190,18 @@ test('tea complete child: every screen has data', async ({ page }) => {
|
|||||||
await expect(section('Qué calcula').locator('p').first()).toHaveText(/ADOS-2/);
|
await expect(section('Qué calcula').locator('p').first()).toHaveText(/ADOS-2/);
|
||||||
await expect(
|
await expect(
|
||||||
section('Puntuaciones z por métrica y zona').locator('app-plot .point').first(),
|
section('Puntuaciones z por métrica y zona').locator('app-plot .point').first(),
|
||||||
).toBeVisible();
|
).toBeAttached();
|
||||||
await expect(
|
await expect(
|
||||||
section('Razones de momios por par').locator('app-plot .point').first(),
|
section('Razones de momios por par').locator('app-plot .point').first(),
|
||||||
).toBeVisible();
|
).toBeAttached();
|
||||||
await expect(
|
await expect(
|
||||||
section('Probabilidad frente a la referencia').locator('tbody tr').first(),
|
section('Probabilidad frente a la referencia').locator('tbody tr').first(),
|
||||||
).toBeVisible();
|
).toBeVisible();
|
||||||
await expect(section('Probabilidad según z').locator('app-plot .point').first()).toBeVisible();
|
await expect(section('Probabilidad según z').locator('app-plot .point').first()).toBeAttached();
|
||||||
await expect(section('Limitaciones').locator('p').first()).toHaveText(/cohorte/);
|
await expect(section('Limitaciones').locator('p').first()).toHaveText(/cohorte/);
|
||||||
|
|
||||||
await page.goto('/gobernanza/tea');
|
await page.goto('/gobernanza/tea');
|
||||||
await expect(page.getByRole('region', { name: 'Ejecución' }).getByRole('status')).toHaveText(
|
await expect(page.getByRole('region', { name: 'Ejecución' }).getByRole('status')).toContainText(
|
||||||
'Disponible',
|
'Disponible',
|
||||||
);
|
);
|
||||||
const models = page.getByRole('region', { name: 'Modelos' });
|
const models = page.getByRole('region', { name: 'Modelos' });
|
||||||
@@ -220,8 +227,8 @@ test('tea complete child: every screen has data', async ({ page }) => {
|
|||||||
).toBeVisible();
|
).toBeVisible();
|
||||||
await models.getByRole('button', { name: 'Evaluar un solo estudio' }).click();
|
await models.getByRole('button', { name: 'Evaluar un solo estudio' }).click();
|
||||||
const preview = page.locator('app-eeg-preview');
|
const preview = page.locator('app-eeg-preview');
|
||||||
await expect(preview.getByLabel('EDF')).toBeVisible();
|
await expect(preview.getByLabel('EDF')).toBeAttached();
|
||||||
await expect(preview.getByLabel('ADOS-2 (PDF)')).toBeVisible();
|
await expect(preview.getByLabel('ADOS-2 (PDF)')).toBeAttached();
|
||||||
await expect(preview.getByLabel('Fecha de nacimiento')).toBeVisible();
|
await expect(preview.getByLabel('Fecha de nacimiento')).toBeVisible();
|
||||||
await expect(page.getByRole('heading', { name: 'Vista previa', level: 2 })).toHaveCount(0);
|
await expect(page.getByRole('heading', { name: 'Vista previa', level: 2 })).toHaveCount(0);
|
||||||
expect(problems).toEqual([]);
|
expect(problems).toEqual([]);
|
||||||
|
|||||||
Reference in New Issue
Block a user