Obsah článku / Contents
Sentinel: Keď AI generuje testovacie scenáre za vás

Sentinel: Keď AI generuje testovacie scenáre za vás

Koľko hodín ste strávili písaním testovacích scenárov? Koľkokrát ste manuálne prechádzali aplikáciu a zapisovali si: "klikni tu, vyplň toto, skontroluj tamto"?

Sentinel tento problém rieši fundamentálne iným prístupom: nechajte AI, nech to urobí za vás.

Problém: Prečo sú testovacie scenáre kritické?

Každý QA engineer pozná túto situáciu:

Developer: "Hotovo, môžeš otestovať?"
QA: "Aké sú test cases?"
Developer: "Ehm... funguje to?"

Bez definovaných testovacích scenárov:

  • ❌ Testujete náhodne - niečo preskočíte
  • ❌ Rôzni testeri testujú rôzne veci
  • ❌ Regresné bugy prechádzajú do produkcie
  • ❌ Nikto nevie, čo vlastne bolo otestované
  • ❌ Automation engineer nemá z čoho vychádzať

S definovanými scenármi:

  • ✅ Konzistentné pokrytie funkcionality
  • ✅ Reprodukovateľné testy
  • ✅ Jasná dokumentácia čo aplikácia robí
  • ✅ Základ pre automatizáciu
  • ✅ Onboarding nových členov tímu

Realita v praxi

Písanie testovacích scenárov je časovo náročné:

1 stránka aplikácie = 30-60 minút analýzy a písania
50 stránok = 25-50 hodín práce

+ každá zmena = update scenárov
+ nové features = nové scenáre
= nikdy nekončiaca práca

A teraz si predstavte, že toto všetko urobí AI za 5 minút.

Riešenie: Sentinel - Automated Test Scenario Generator

Sentinel je Python nástroj, ktorý:

1

Prehľadá

vašu webovú aplikáciu (vrátane SPA)
2

Identifikuje

všetky interaktívne elementy
3

Vygeneruje

testovacie scenáre pomocou lokálneho LLM
Web Aplikácia → Sentinel → JSON Scenáre → Playwright/Selenium

Ako to funguje?

bash
# Spustenie je jednoduché
uv run python main.py --url https://your-app.com --username admin --password secret

# Výstup: results/all_generated_scenarios.json

Pipeline:

1. WebNavigator (Playwright)
   └── Prihlásenie do aplikácie
   └── Navigácia medzi stránkami

2. DeepExplorer
   ├── Objavenie všetkých navigačných prvkov
   ├── Extrakcia dropdown menu
   ├── Identifikácia CRUD tlačidiel
   ├── Analýza formulárov
   └── Detekcia tabuliek a modálov

3. CrewAI Agent (Ollama LLM)
   └── Generovanie test scenárov pre každú stránku

Čo Sentinel objaví?

Sentinel používa 50+ CSS selektorov na detekciu:

Navigácia:

  • Menu položky, submenu, dropdowny
  • SPA router linky (Angular routerLink, Vue to, React href)
  • Tabs a záložky
  • Profile/user menu

Akčné tlačidlá:

python
# Sentinel rozpoznáva 11 typov akcií:
- create, edit, delete, save, cancel  # CRUD
- filter, search, clear               # Vyhľadávanie
- export, import, refresh             # Dátové operácie

Formuláre:

  • Input polia s typmi a validáciou
  • Select boxy a datepickery
  • Checkbox a radio buttony
  • Submit tlačidlá

Tabuľky:

  • Štruktúra stĺpcov
  • Pagination
  • Row selection
  • Sorting

Príklad vygenerovaného scenára

json
{
  "page_url": "https://app.example.com/users",
  "scenarios": [
    {
      "name": "Test Happy Path - Create New User",
      "description": "Verify admin can create new user account",
      "steps": [
        {
          "action": "click",
          "selector": "button[data-testid='btn-create']",
          "value": "",
          "description": "Click Create User button"
        },
        {
          "action": "fill",
          "selector": "input[name='email']",
          "value": "newuser@test.com",
          "description": "Fill email field"
        },
        {
          "action": "fill",
          "selector": "input[name='name']",
          "value": "Test User",
          "description": "Fill name field"
        },
        {
          "action": "click",
          "selector": "button[type='submit']",
          "value": "",
          "description": "Submit form"
        },
        {
          "action": "verify_text",
          "selector": ".toast-success",
          "value": "User created successfully",
          "description": "Verify success message"
        }
      ]
    }
  ]
}

Tento JSON môžete priamo použiť v Playwright alebo Selenium test runner!

Kľúčové výhody Sentinel

1. Lokálne LLM = Žiadne dáta do cloudu

bash
# Sentinel používa Ollama - beží lokálne
LLM_API_URL="http://localhost:11434"
LLM_MODEL="llama3.1"

Prečo je to dôležité?

  • ✅ Firemné dáta zostávajú v sieti
  • ✅ Žiadne API poplatky za token
  • ✅ Funguje aj offline
  • ✅ GDPR/compliance friendly

2. SPA Support z krabice

Moderné aplikácie (Angular, React, Vue) majú komplexnú navigáciu:

typescript
// Angular
<a routerLink="/users">Users</a>

// React
<Link to="/users">Users</Link>

// Vue
<router-link to="/users">Users</router-link>

Sentinel toto všetko rozpozná a správne naviguje medzi stránkami.

3. Multi-User Testing

Testovanie s rôznymi rolami? Žiadny problém:

env
USERS='[
  {"username": "admin", "password": "admin123", "role": "admin"},
  {"username": "user", "password": "user123", "role": "user"},
  {"username": "viewer", "password": "view123", "role": "viewer"}
]'

Sentinel otestuje aplikáciu s každým používateľom a vygeneruje scenáre podľa toho, čo daná rola vidí.

4. Tri spôsoby integrácie

bash
# 1. CLI - jednoduché spustenie
uv run python main.py

# 2. MCP Server - integrácia s Claude
# tools: analyze_web_application, explore_web_application

# 3. gRPC Service - remote volania
# port 50051, language-agnostic

Praktický use case: QA tím bez automation engineera

Situácia:

  • Malý tím, 3 developeri, 1 QA
  • QA manuálne testuje, nemá čas na automation
  • Management chce "viac testov, rýchlejšie"

Riešenie so Sentinel:

bash
# 1. Spustíte Sentinel na staging environment
uv run python main.py \
  --url https://staging.app.com \
  --login-url https://staging.app.com/login \
  --username qa@company.com \
  --password secret \
  --max-pages 100

# 2. Dostanete JSON so všetkými scenármi

# 3. QA engineer review scenáre a upraví podľa potreby

# 4. Scenáre môžete použiť ako:
#    - Manuálny test checklist
#    - Základ pre Playwright testy
#    - Dokumentáciu funkcionality

Výsledok:

  • ⏱️ 50 hodín manuálnej práce → 30 minút
  • 📋 Komplexné pokrytie aplikácie
  • 🤖 Základ pre automation

Prečo sú test scenáre dôležité (aj keď máte automation)?

1. Dokumentácia správania

Test scenáre sú živá dokumentácia:

json
{
  "name": "User cannot delete own account",
  "description": "Verify delete button is disabled for current user"
}

Toto vám povie viac o aplikácii ako komentár v kóde.

2. Základ pre automatizáciu

Bez scenárov automation engineer háda:

typescript
// ❌ Bez scenárov
test('test login', async () => {
  // čo vlastne testujeme?
  // aké sú expected results?
  // edge cases?
});

// ✅ So scenármi
test('Login with valid credentials shows dashboard', async () => {
  // Jasný cieľ z JSON scenára
  await page.fill('[data-testid="input-email"]', 'user@test.com');
  await page.fill('[data-testid="input-password"]', 'password');
  await page.click('[data-testid="btn-login"]');
  await expect(page.locator('h1')).toContainText('Dashboard');
});

3. Onboarding nových členov

Nový QA engineer sa pýta: "Čo všetko táto aplikácia robí?"

Odpoveď: "Pozri all_generated_scenarios.json"

4. Regresné testovanie

Po každom release:

  1. Spustíte Sentinel
  2. Porovnáte scenáre s predchádzajúcimi
  3. Vidíte čo sa zmenilo
bash
diff results/v1.0_scenarios.json results/v1.1_scenarios.json

Architektúra Sentinel

┌─────────────────────────────────────────────────┐
│                 User Interface                   │
│    CLI │ MCP Server │ gRPC Service              │
└────────────────────┬────────────────────────────┘
                     ↓
┌─────────────────────────────────────────────────┐
│              Main Orchestrator                   │
│   - Multi-user workflow                         │
│   - Results aggregation                         │
└────────────────────┬────────────────────────────┘
                     ↓
┌────────────┬───────────────┬────────────────────┐
│WebNavigator│ DeepExplorer  │    CrewAI Agent    │
│ Playwright │  Discovery    │   Ollama LLM       │
│ Auth       │  Elements     │   Test Generation  │
└────────────┴───────────────┴────────────────────┘
                     ↓
┌─────────────────────────────────────────────────┐
│          JSON Test Scenarios                     │
│   results/all_generated_scenarios.json          │
└─────────────────────────────────────────────────┘

Hlavné komponenty:

  • WebNavigator (693 riadkov) - Playwright wrapper, autentifikácia, navigácia
  • DeepExplorer (600+ riadkov) - Inteligentná explorácia UI
  • CrewAI Agent (106 riadkov) - LLM integrácia cez Ollama

Quick Start

bash
# 1. Nainštalujte dependencies
pip install playwright crewai langchain-ollama

# 2. Nainštalujte Playwright browsers
playwright install chromium

# 3. Spustite Ollama s modelom
ollama run llama3.1

# 4. Nakonfigurujte .env
cat > .env << EOF
TARGET_URL="https://your-app.com"
LOGIN_URL="https://your-app.com/login"
USERS='[{"username":"admin","password":"secret","role":"admin"}]'
LLM_API_URL="http://localhost:11434"
LLM_MODEL="llama3.1"
HEADLESS="false"
MAX_PAGES="50"
EOF

# 5. Spustite Sentinel
uv run python main.py

Záver

Sentinel mení pravidlá hry v QA:

Tradičný prístupSo Sentinel
Manuálne prechádzanie UIAutomatická explorácia
Hodiny písania scenárovMinúty generovania
Nekompletné pokrytieSystematický prehľad
Static dokumentáciaŽivé scenáre z UI

Kedy použiť Sentinel:

  • ✅ Nový projekt potrebuje test coverage
  • ✅ Legacy aplikácia bez dokumentácie
  • ✅ QA tím potrebuje automation základ
  • ✅ Audit funkcionality pred refactorom

Test scenáre nie sú luxus - sú nevyhnutnosť. A Sentinel vám ich vygeneruje automaticky.


Sentinel je open-source projekt dostupný pre tímy, ktoré chcú zefektívniť svoj QA proces bez závislosti na cloud AI službách.

Všetky články