Files
GerbilManager/gerbil-manager-web/e2e/genetik.spec.ts

41 lines
1.8 KiB
TypeScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
/** QA-1: Genetik (FEAT-5/GEN-1) — Probeverpaarung inkl. SCHECKE-Warnung. */
import { de, expect, gotoSection, test } from './fixtures'
const t = de.pages.genetik
function genotypeInput(page: import('@playwright/test').Page, parent: string) {
return page
.locator('fieldset.parent-selector')
.filter({ has: page.getByText(parent, { exact: true }) })
.getByLabel(t.genotypeLabel)
}
test('Probeverpaarung rechnet client-seitig und zeigt Nachkommen-Farbschläge', async ({ page }) => {
await gotoSection(page, de.nav.genetics)
await expect(page.getByText(t.subtitle)).toBeVisible()
await expect(page.getByText(t.needBoth)).toBeVisible()
await genotypeInput(page, t.father).fill('AA CC DD EE GG PP spsp rere')
await genotypeInput(page, t.mother).fill('aa CC DD EE GG PP spsp rere')
await expect(page.getByRole('heading', { name: t.resultsTitle })).toBeVisible()
// AA × aa -> alle Nachkommen Aa = Agouti (Farbschlag-Karte)
await expect(page.locator('.farbschlag-card').filter({ hasText: 'Agouti' }).first()).toBeVisible()
})
test('Schecke × Schecke zeigt die deutsche Letalwarnung', async ({ page }) => {
await gotoSection(page, de.nav.genetics)
// Beide Eltern Spsp (Schecke): SpSp ist letal -> Warnhinweis
await genotypeInput(page, t.father).fill('Aa CC DD EE GG PP Spsp rere')
await genotypeInput(page, t.mother).fill('Aa CC DD EE GG PP Spsp rere')
await expect(page.getByRole('heading', { name: t.warningsTitle })).toBeVisible()
await expect(page.getByText(de.genetics.warnings.SCHECKE_LETHAL)).toBeVisible()
})
test('ungültiger Genotyp zeigt die deutsche Fehlermeldung', async ({ page }) => {
await gotoSection(page, de.nav.genetics)
await genotypeInput(page, t.father).fill('kein genotyp')
await expect(page.getByText(t.genotypeInvalid)).toBeVisible()
})