SprilurTests Auth

Repte 2FA sense sessió prèvia

Editar
/

Test validat correctament

L'script s'ha executat i ha passat després de 0 iteracions de refinament.

La IA ajustarà l'script segons el teu feedback i el validarà automàticament.

Prompt

Sense iniciar cap sessió, navega directament a la URL https://p396.tst.twentic.com/two-factor-challenge. Comprova que el sistema et redirigeix automàticament a la pàgina de login (/login) en comptes de mostrar el formulari de repte 2FA.

Pla de Test 2 pag · 3 passos · 5 validacions

Pàgines a visitar

/two-factor-challenge Entry point for the 2FA challenge — should redirect unauthenticated users to login
/login Login page where unauthenticated users are redirected

Passos del test

Validacions

Current URL must be /login — the 2FA challenge redirected the unauthenticated user body
Login page heading 'Login' is visible, confirming the user is on the login page h1
Email input field is present on the login page input[name='email']
Password input field is present on the login page input[name='password']
Login submit button 'Entrar' is visible button[type='submit']

Historial de validació 1 iteracions

#? FAIL

Passos del Test 1 steps

1

Navigate to 2FA challenge page without session

Navigates directly to the 2FA challenge page without an active session, waits for redirect to login page, and verifies the login form elements are present

stable (4x)
step3675-login-redirect-after-2fa-challenge

step3675 login redirect after 2fa challenge

1. navigate Navigate directly to the 2FA challenge page without any active session
2. wait Wait for the redirect to complete and the login page to load h1
3. screenshot Capture the resulting page to confirm it is the login page
Login page heading 'Login' is visible, confirming the user is on the login page
Generació inicial FAIL
#1 FAIL input[name=\'email\'] · refine
Temps d'espera exhaurit — l'element no es va trobar o la pàgina no va acabar de carregar.
expect(locator).toHaveCount(expected) failed Locator: locator('input[name=\'email\']') Expected: 1 Received: 2 Timeout... [veure tot] expect(locator).toHaveCount(expected) failed Locator: locator('input[name=\'email\']') Expected: 1 Received: 2 Timeout: 5000ms Call log: - Expect "to.have.count" with timeout 5000ms - waiting for locator('input[name=\'email\']') 9 × locator resolved to 2 elements - unexpected value "2"
#2 FAIL input[name=\'email\']:visible · refine
Temps d'espera exhaurit — l'element no es va trobar o la pàgina no va acabar de carregar.
expect(locator).toHaveCount(expected) failed Locator: locator('input[name=\'email\']:visible') Expected: 1 Received: 2... [veure tot] expect(locator).toHaveCount(expected) failed Locator: locator('input[name=\'email\']:visible') Expected: 1 Received: 2 Timeout: 5000ms Call log: - Expect "to.have.count" with timeout 5000ms - waiting for locator('input[name=\'email\']:visible') 9 × locator resolved to 2 elements - unexpected value "2"
#3 FAIL input[name=\'password\']:visible · regenerate
Temps d'espera exhaurit — l'element no es va trobar o la pàgina no va acabar de carregar.
expect(locator).toHaveCount(expected) failed Locator: locator('input[name=\'password\']:visible') Expected: 1 Received... [veure tot] expect(locator).toHaveCount(expected) failed Locator: locator('input[name=\'password\']:visible') Expected: 1 Received: 2 Timeout: 5000ms Call log: - Expect "to.have.count" with timeout 5000ms - waiting for locator('input[name=\'password\']:visible') 9 × locator resolved to 2 elements - unexpected value "2"

Codi Playwright tots els passos · // @lock / // @unlock per protegir línies

Desat ✓ Edita directament · usa // @lock i // @unlock en línies separades per bloquejar una secció

Resum d'execució

Test estable · tots els passos correctes

Generant resum de l'execució…

Detalls

Estat
active
Generació
stable
Validació
stable
Tipus
Playwright
Creat
03/06/2026 14:31

Tags

Tots els tags afegits

Cap tag assignat

Instruccions IA

Projecte

- **Locale coverage:** every public page and every key flow must be exercised in **both `/es` and `/eu`**; additionally verify the `/locale/{eu}` switch redirects back and persists in session. - **Default test account:** `admin@sprilur.test` / `password` (is_admin, verified, no 2FA) — use for `/admin` and authenticated frontend flows. For permission tests, use a **non-admin verified** user. - **Data conventions:** suffix any created test data (project `title`, document name, etc.) with a unique `uid` (timestamp/run id) to avoid collisions across runs. - **Mandatory assertions:** every form submission must assert the success outcome (redirect/toast) **and** the absence of validation errors; every navigation must assert the resulting **URL including its locale prefix**. - **Scope/priority:** auth + private project flows (login, create, evaluate, export) are **regression-critical** and get happy-path + key edge cases; public/buscador flows get happy path plus the "no guide type / no results / URL hydration" edges; backoffice gets representative CRUD smoke tests. - **Known seeded data to rely on:** - Guide types: **Urbanización** (`urbanization`), **Edificación** (`building`). - Typologies (urbanization): Residencial, Industrial, Terciario, Logístico, Equipamiento público, Mixto. (building): Edificio industrial, Edificio terciario. - Scopes (ámbito): **Proyecto**, **Obra**. - Chapters: GEN General, TRA Trabajos previos, PRE, VIA, AGU Agua, EST, ENE Energía, ZON, RES Residuos, EJE, MAN; (building) EDI Diseño del edificio, ENV. - Agents: Promotor, Proyectista, Constructor, Dirección facultativa, Administración pública, Empresa de mantenimiento. - Stages (Etapa): Planeamiento, Proyecto, Ejecución, Uso y mantenimiento, Fin de vida. - **Exports:** for PDF/CSV, assert the response/download headers (and CSV `;`/`,` formatting), not the binary contents.

Features Desat!

KPIs

Taxa d'èxit
100%
1r intent OK
0%
Iteracions totals
4
Temps total
56s
→ Validació
56s
Cost total
$0.1969
Tokens totals
131,919
Crides API
6
→ Cost/pas
$0.00c

Cost IA

Total
$0.1969
Generació
$0.0883
Execucions
$0.00c
Tokens totals
131,919
Crides API
6