Add Playwright E2E suite (46 tests) + app testids + test_cases.md

- e2e/: full Playwright suite covering every spec case (staff auth/UI,
  welcome + session check-in, attendee access/gating, connections,
  profile visibility, speaker material, sponsor, feedback, E2E journeys,
  role security matrix). 46/46 passing.
- apps/convivo: add data-testid attributes (gate, tabs, scanner, toggles)
  to support the E2E suite.
- test_cases.md: spec-case-to-test coverage map (all cases fully covered).
- .gitignore: ignore e2e node_modules/reports/test-results.

Co-authored-by: Stephan Charles <[email protected]>
Co-authored-by: Amelia Hernandez <[email protected]>
Co-authored-by: Markus Franz <[email protected]>
Co-authored-by: Sabrina Hota <[email protected]>
Co-authored-by: Nilüfer Doğan <[email protected]>
This commit is contained in:
committed 2026-09-09 10:13:26 +02:00
1 parent b08a439949
commit d5ec009cb5
44 files changed
+3715 -26

No files matched your search

+3 -3
View File
@@ -210,12 +210,12 @@ export function Agenda({ openFeedback }: { openFeedback: (sessionId: string) =>
{/* Speaker material: non-dismissible notification until uploaded. */}
{selNeedsMaterial && (
<div className="material-notice">
<div className="material-notice" data-testid="material-upload-notice">
<div className="mn-title">📎 Upload your session material</div>
<div className="muted small" style={{ marginBottom: 10 }}>
Attendees can download your slides/notes from this session.
</div>
<input ref={fileRef} type="file" className="input" onChange={handleUpload} />
<input ref={fileRef} type="file" data-testid="material-upload" className="input" onChange={handleUpload} />
</div>
)}
@@ -246,7 +246,7 @@ export function Agenda({ openFeedback }: { openFeedback: (sessionId: string) =>
<div style={{ display: 'flex', flexDirection: 'column', gap: 8 }}>
{selStatus === 'done' && selCheckedIn && (
<button className="btn primary" onClick={() => openFeedback(selected.id)}>
<button className="btn primary" data-testid="give-feedback" onClick={() => openFeedback(selected.id)}>
Give feedback ⭐
</button>
)}
+4 -4
View File
@@ -73,8 +73,8 @@ export function Connections() {
<section className="screen">
<div className="h1">Connections</div>
<div className="seg">
<button className={tab === 'mine' ? 'active' : ''} onClick={() => setTab('mine')}>My connections</button>
<button className={tab === 'req' ? 'active' : ''} onClick={() => setTab('req')}>
<button className={tab === 'mine' ? 'active' : ''} data-testid="connections-tab-mine" onClick={() => setTab('mine')}>My connections</button>
<button className={tab === 'req' ? 'active' : ''} data-testid="connections-tab-req" onClick={() => setTab('req')}>
Requests {incoming.length + outgoing.length > 0 && <span className="pill violet" style={{ marginLeft: 4 }}>{incoming.length + outgoing.length}</span>}
</button>
</div>
@@ -120,8 +120,8 @@ export function Connections() {
)}
</div>
</div>
<button className="btn primary small" onClick={() => resolve(c.id, true)}>Accept</button>
<button className="btn small" onClick={() => resolve(c.id, false)}>Decline</button>
<button className="btn primary small" data-testid="connection-accept" onClick={() => resolve(c.id, true)}>Accept</button>
<button className="btn small" data-testid="connection-decline" onClick={() => resolve(c.id, false)}>Decline</button>
</div>
))}
</div>
+3 -1
View File
@@ -58,6 +58,7 @@ export function Feedback({ sessionId, onDone }: { sessionId: string; onDone: ()
{[1, 2, 3, 4, 5].map((n) => (
<button
key={n}
data-testid={`feedback-star-${n}`}
className={`star ${n <= rating ? 'on' : ''}`}
onClick={() => setRating(n)}
aria-label={`${n} star${n > 1 ? 's' : ''}`}
@@ -69,13 +70,14 @@ export function Feedback({ sessionId, onDone }: { sessionId: string; onDone: ()
<textarea
className="input"
data-testid="feedback-comment"
placeholder="Add a comment (optional) — comments earn bonus points"
value={comment}
onChange={(e) => setComment(e.target.value)}
rows={4}
/>
<button className="btn primary" disabled={busy || rating === 0} onClick={submit}>
<button className="btn primary" data-testid="feedback-submit" disabled={busy || rating === 0} onClick={submit}>
{busy ? 'Submitting…' : 'Submit feedback'}
</button>
<div className="muted small" style={{ textAlign: 'center', marginTop: 8 }}>
+2 -2
View File
@@ -149,7 +149,7 @@ export function Home({ go }: { go: (tab: string) => void }) {
</div>
<div className="row" style={{ gap: 8 }}>
{pendingMaterial.length > 0 && (
<div className="material-pill" onClick={() => setMaterialSheetOpen(true)}>
<div className="material-pill" data-testid="material-pill" onClick={() => setMaterialSheetOpen(true)}>
📎 {pendingMaterial.length}
</div>
)}
@@ -159,7 +159,7 @@ export function Home({ go }: { go: (tab: string) => void }) {
{/* Pending feedback: nudge to rate a session they attended. */}
{feedbackPending.length > 0 && (
<button className="feedback-pill" onClick={() => go('agenda')}>
<button className="feedback-pill" data-testid="feedback-pill" onClick={() => go('agenda')}>
⭐ {feedbackPending.length === 1 ? 'Rate your last session' : `Rate ${feedbackPending.length} sessions`}
</button>
)}
+5 -2
View File
@@ -68,7 +68,7 @@ export function Login() {
if (step === 'splash') {
return (
<section className="screen no-tab splash" onClick={() => setStep('scan')}>
<section className="screen no-tab splash" data-testid="login-splash" onClick={() => setStep('scan')}>
<div className="logo"><img src="/icon-192.png" alt="APPE" /></div>
<div className="splash-title">APPE</div>
<div className="splash-tag">Break the ice. Earn the points.</div>
@@ -112,6 +112,7 @@ export function Login() {
<input
className="input"
type="password"
data-testid="staff-login-password"
placeholder="••••••••••"
value={staffPassword}
onChange={(e) => setStaffPassword(e.target.value)}
@@ -128,6 +129,7 @@ export function Login() {
<input
className="input"
type="email"
data-testid="attendee-login-email"
placeholder="[email protected]"
value={email}
onChange={(e) => setEmail(e.target.value)}
@@ -137,9 +139,10 @@ export function Login() {
</>
)}
</div>
{error && <div className="muted small" style={{ color: 'var(--red)' }}>{error}</div>}
{error && <div className="muted small" data-testid="login-error" style={{ color: 'var(--red)' }}>{error}</div>}
<button
className="btn primary"
data-testid="login-confirm"
disabled={busy || (isStaff ? !staffPassword : !email.trim())}
onClick={confirm}
>
+5 -4
View File
@@ -103,16 +103,17 @@ export function Profile() {
<input
className="input"
type="url"
data-testid="profile-linkedin-url"
placeholder="https://linkedin.com/in/you"
value={linkedin}
onChange={(e) => setLinkedin(e.target.value)}
/>
</div>
<div style={{ display: 'flex', flexDirection: 'column', gap: 10, marginBottom: 14 }}>
<Toggle checked={showEmail} onChange={setShowEmail} label="Show my email" />
<Toggle checked={showLinkedin} onChange={setShowLinkedin} label="Show my LinkedIn" />
<Toggle checked={showEmail} onChange={setShowEmail} label="Show my email" testId="profile-show-email" />
<Toggle checked={showLinkedin} onChange={setShowLinkedin} label="Show my LinkedIn" testId="profile-show-linkedin" />
</div>
<button className="btn primary" disabled={saving} onClick={() => void saveProfile()}>
<button className="btn primary" data-testid="profile-save" disabled={saving} onClick={() => void saveProfile()}>
{saving ? 'Saving…' : 'Save profile'}
</button>
</div>
@@ -139,7 +140,7 @@ export function Profile() {
)}
</div>
<button className="btn danger" onClick={() => void signOut()}>Log out</button>
<button className="btn danger" data-testid="profile-logout" onClick={() => void signOut()}>Log out</button>
</section>
);
}
+7 -7
View File
@@ -109,8 +109,8 @@ export function Scan() {
</div>
{isStaff && (
<div className="seg" style={{ width: 170 }}>
<button className={mode === 'attendee' ? 'active' : ''} onClick={() => setMode('attendee')}>Attendee</button>
<button className={mode === 'staff' ? 'active' : ''} onClick={() => setMode('staff')}>Staff</button>
<button className={mode === 'attendee' ? 'active' : ''} data-testid="scan-mode-attendee" onClick={() => setMode('attendee')}>Attendee</button>
<button className={mode === 'staff' ? 'active' : ''} data-testid="scan-mode-staff" onClick={() => setMode('staff')}>Staff</button>
</div>
)}
</div>
@@ -119,7 +119,7 @@ export function Scan() {
<div>
<div className="row between" style={{ marginBottom: 10 }}>
<span className="muted small" style={{ fontWeight: 700 }}>Check-in type</span>
<label className="uiverse-toggle" title={welcomeMode ? 'Welcome check-in' : 'Session check-in'}>
<label className="uiverse-toggle" data-testid="welcome-checkin-toggle" title={welcomeMode ? 'Welcome check-in' : 'Session check-in'}>
<input
type="checkbox"
checked={welcomeMode}
@@ -134,7 +134,7 @@ export function Scan() {
) : (
<>
<div className="muted small" style={{ marginBottom: 7 }}>Checking in to session</div>
<select className="input" value={sessionId} onChange={(e) => setSessionId(e.target.value)}>
<select className="input" data-testid="session-selector" value={sessionId} onChange={(e) => setSessionId(e.target.value)}>
{slots
.filter(({ slot }) => slot.type !== 'service_session')
.map(({ slot, sessions }) => (
@@ -175,7 +175,7 @@ export function Scan() {
</div>
)}
<div style={{ marginTop: 16 }}>
<button className="btn primary" disabled={busy} onClick={confirmConnect}>
<button className="btn primary" data-testid="connection-send" disabled={busy} onClick={confirmConnect}>
{busy ? 'Sending…' : 'Connect 🤝'}
</button>
<button className="btn ghost" style={{ marginTop: 8 }} onClick={() => setConnectTarget(null)}>
@@ -189,7 +189,7 @@ export function Scan() {
{/* Check-in result sheet */}
<Sheet open={!!checkin} onClose={() => setCheckin(null)}>
{checkin && (
<div style={{ textAlign: 'center' }}>
<div style={{ textAlign: 'center' }} data-testid="session-checkin-result">
<div style={{ fontSize: 52 }}>{checkin.already ? '⚠️' : '✅'}</div>
<h3 style={{ marginTop: 10 }}>{checkin.attendee_name}</h3>
<div className="sub">{checkin.already ? 'Already checked in' : 'Checked in'}</div>
@@ -210,7 +210,7 @@ export function Scan() {
{/* Welcome check-in result sheet */}
<Sheet open={!!welcome} onClose={() => setWelcome(null)}>
{welcome && (
<div style={{ textAlign: 'center' }}>
<div style={{ textAlign: 'center' }} data-testid="welcome-checkin-result">
<div style={{ fontSize: 52 }}>{welcome.already ? '⚠️' : '👋'}</div>
<h3 style={{ marginTop: 10 }}>{welcome.attendee_name}</h3>
<div className="sub">{welcome.already ? 'Already checked in to the event' : 'Welcome to the event!'}</div>