diff --git a/README.md b/README.md index 3d48102..d99fa1c 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ GitHub Actions runs the functional and browser suites on pushes and pull request | Requirement 121 startup test can time out | A slow API startup can fail the reminder test before it reaches the notification assertions. | | Checkout supports Stripe sandbox only | Card payments use test transactions in EGP. Checkout needs an `sk_test_` key and accepts one settlement method per request. | | SMTP and Google Calendar need separate configuration | Email password reset, probation emails and Calendar sync need provider credentials. Automated tests use local mail and controlled provider responses. Live provider availability needs a separate check. | -| Optional advisor and administrator seeds require prepared fixtures | The advisor preview seed expects a published Scientific Methods offering and a future term. The administrator preview seed looks up student IDs that differ from those created by Quick demo sign-in. The installation steps use the base and timetable seeds. | +| Optional advisor and administrator seeds require prepared fixtures | The advisor preview seed expects a published Scientific Methods offering and a future term. The administrator preview seed looks up student IDs that differ from those used by the standard sign-in fixtures. The installation steps use the base and timetable seeds. | | Assessment deployment needs its own accounts and data | Local seed fixtures are for development. The hosted portal needs provisioned university accounts and a smoke test of each role. See [production readiness](docs/production-readiness.md). | ## Code style @@ -190,15 +190,15 @@ Install **Git, Node.js 22.12 or later with npm, MongoDB Community 8.x, and Mongo ~~~powershell mongosh --host 127.0.0.1 --eval "rs.initiate({_id:'rs0',members:[{_id:0,host:'127.0.0.1:27017'}]})" - $env:BOBOS_PORTAL_DEMO='standard' npm run dev ~~~ - Open [the portal](http://localhost:5173/) and check [API health](http://localhost:3000/api/health). The health response should include `"database":"connected"`. The frontend proxies `/api` requests locally. Quick demo sign-in is available only on localhost; hosted deployments use university credentials. On macOS or Linux use `export BOBOS_PORTAL_DEMO=standard` before starting. + Open [the portal](http://localhost:5173/) and check [API health](http://localhost:3000/api/health). The health response should include `"database":"connected"`. The frontend proxies `/api` requests locally. Sign in with your university email and password. 4. On a **fresh local demo database**, open a third terminal in Bobos to load sample academic data and create the demo accounts. Keep `ALLOW_DEMO_SEED=true` in your local `.env` for this step. ~~~powershell + $env:BOBOS_PORTAL_DEMO='standard' npm run seed --workspace @bobos/api Invoke-RestMethod -Method Post http://localhost:3000/api/identity/seed-demo | Out-Null npm run seed:group4 --workspace @bobos/api @@ -206,7 +206,7 @@ Install **Git, Node.js 22.12 or later with npm, MongoDB Community 8.x, and Mongo The base seed clears user, student, course, term, and offering collections in the configured database. `seed:group4` replaces the active timetable of the two demo student accounts. Use the sample accounts and database for this recipe. See the [B1 fixture guide](docs/b1-seed.md) for more request-history scenarios and the [configuration template](.env.example) for SMTP, Stripe sandbox, and Google Calendar settings. - If you use Bash, run `curl -X POST http://localhost:3000/api/identity/seed-demo` in place of `Invoke-RestMethod`. + If you use Bash, set `export BOBOS_PORTAL_DEMO=standard` before the base seed and run `curl -X POST http://localhost:3000/api/identity/seed-demo` in place of `Invoke-RestMethod`. ### Optional integrations @@ -216,7 +216,7 @@ Install **Git, Node.js 22.12 or later with npm, MongoDB Community 8.x, and Mongo | Stripe | Set `STRIPE_SECRET_KEY` to a sandbox key and `WEB_ORIGIN` to the portal origin. Use a Stripe test card through **Pay by card**. | | Google Calendar | Set `GOOGLE_CLIENT_ID`, `GOOGLE_CLIENT_SECRET`, and `GOOGLE_REDIRECT_URI`. Register `http://localhost:3000/api/calendar/oauth/callback` in Google Cloud for the default ports. Generate a separate 32-byte hex value for `CALENDAR_TOKEN_ENCRYPTION_KEY`. Sign in as a student and open **Calendar sync**. | -For more advising data, run `npm run seed:evaluation --workspace @bobos/api` on a separate local demo database. If you need the dedicated extra-hours payment scenarios, set `EXTRA_HOURS_DEMO_URI` to `mongodb://127.0.0.1:27017/extra_hours_manual?replicaSet=rs0` and run `node scripts/seed-extra-hours-demo.mjs`. To view these accounts, point the local API's `MONGODB_URI` at that database and restart with `BOBOS_PORTAL_DEMO=extra-hours`. +For more advising data, run `npm run seed:evaluation --workspace @bobos/api` on a separate local demo database. If you need the dedicated extra-hours payment scenarios, set `EXTRA_HOURS_DEMO_URI` to `mongodb://127.0.0.1:27017/extra_hours_manual?replicaSet=rs0` and run `node scripts/seed-extra-hours-demo.mjs`. To view these accounts, point the local API's `MONGODB_URI` at that database and restart the API, then enter the fixture credentials on the sign-in screen. For a static frontend build, run `npm run build`. If frontend and API run on different hosts, set `VITE_API_BASE_URL` at build time to the API origin and `WEB_ORIGIN` on the server to the frontend origin. The API start command is `npm run start --workspace @bobos/api`. @@ -263,7 +263,7 @@ npm run test:regression ## How to use -On the local sign-in screen, open **Quick demo sign-in** and select a role after seeding. You can also sign in with these fixture accounts. They share the local-only password `Password123!`. +Enter one of these seeded accounts on the local sign-in screen. They share the local-only password `Password123!`. | Role | Local demo email | Start here | | --- | --- | --- | diff --git a/apps/web/public/portal-studio/app.js b/apps/web/public/portal-studio/app.js index c8c61e5..57e2bc1 100644 --- a/apps/web/public/portal-studio/app.js +++ b/apps/web/public/portal-studio/app.js @@ -42,7 +42,6 @@ let liveProfile; let liveInbox; let coordinatorSchedules; let liveAdvisor; -const localDemoSignInAvailable = ['localhost','127.0.0.1'].includes(location.hostname); const signedIn = () => Boolean(localStorage.getItem(workspaceSessionKey)); const pageKey = key => Object.hasOwn(pages,key) ? key : 'overview'; const returnPage = key => { @@ -951,7 +950,7 @@ function mountLiveCalendar(panel) { const state = panel.querySelector('.calendar-connection-state'); const controls = panel.querySelector('.calendar-sync-actions'); const syncLabel = 'Sync with Google Calendar'; - let token = localStorage.getItem(workspaceSessionKey); + const token = localStorage.getItem(workspaceSessionKey); let working = false; let refreshing = false; let renderedConnection; @@ -980,19 +979,11 @@ function mountLiveCalendar(panel) { returnAfterSignIn = 'calendar-sync'; navigate('login'); } - const localStudentDemo = ['localhost','127.0.0.1'].includes(location.hostname) && ['normalStudent','advisingStudent'].includes(role); const connectPath = 'connect?' + new URLSearchParams({ portalOrigin: location.origin }); - async function request(path, method = 'GET', retry = true) { + async function request(path, method = 'GET') { const response = await fetch('../api/calendar/' + path, { method, headers: { Authorization: 'Bearer ' + token } }); const data = await response.json(); if (!response.ok) { - if (response.status === 401 && retry && localStudentDemo) { - localStorage.removeItem(workspaceSessionKey); - if (await signInDemoWorkspace(role)) { - token = localStorage.getItem(workspaceSessionKey); - return request(path, method, false); - } - } if ([401, 403].includes(response.status)) { if (response.status === 401) localStorage.removeItem(workspaceSessionKey); controls.replaceChildren(); @@ -1042,15 +1033,7 @@ function mountLiveCalendar(panel) { if (!token) { controls.replaceChildren(); state.textContent = 'Not connected'; - if (localStudentDemo) { - control(syncLabel, async () => { - if (!await signInDemoWorkspace(role)) { signIn(); return; } - token = localStorage.getItem(workspaceSessionKey); - const data = await request('connection'); - if (data.connected) await refresh(); - else location.assign((await request(connectPath)).authorizationUrl); - }, { primary: true, pending: 'Opening Google…' }); - } else control(syncLabel, signIn, { primary: true }); + control(syncLabel, signIn, { primary: true }); return; } async function checkConnection(background = false) { @@ -1138,11 +1121,6 @@ function auth(){ ${page==='reset'?link('forgot','Request another code','auth-recovery'):''} ${link('login','Back to sign in','auth-recovery')}`} - ${page==='login' && localDemoSignInAvailable ? `
- Quick demo sign-in -
${Object.entries(roleNames).map(([id,label])=> - button(label,'preview-sign-in','preview-role-button',`data-preview-role="${id}"`)).join('')}
-
` : ''}
Desk lamp lighting a sheet of paper
@@ -1558,7 +1536,7 @@ function startPreview(destination){ returnAfterSignIn = 'overview'; navigate(destination, url, history.state || {}); } -async function signInWorkspace(credentials, expectedRole){ +async function signInWorkspace(credentials){ const response = await fetch('../api/identity/login', { method:'POST', headers:{'Content-Type':'application/json'}, @@ -1568,40 +1546,12 @@ async function signInWorkspace(credentials, expectedRole){ if (!response.ok || !data.token || !Object.hasOwn(roleNames,data.user?.role)) { throw new Error(data.message || 'Could not sign in to the workspace.'); } - if (expectedRole && data.user.role !== expectedRole) throw new Error('The demo account has a different role.'); localStorage.setItem(workspaceSessionKey,data.token); localStorage.setItem('portal-account-role', data.user.role); sessionStorage.setItem(workspaceAccountNameKey, data.user.fullName || roleNames[data.user.role]); return data.user.role; } -async function signInDemoWorkspace(demoRole){ - const response = await fetch(`../__bobos_local_demo?role=${encodeURIComponent(demoRole)}`); - if (!response.ok || !response.headers.get('content-type')?.includes('application/json')) { - const accounts = { normalStudent:'karim.normal@student.guc.edu.eg', advisingStudent:'layla.advising@student.guc.edu.eg', coordinator:'nadia.coordinator@guc.edu.eg', advisor:'sherif.advisor@guc.edu.eg', administrator:'admin@guc.edu.eg' }; - if (!['localhost','127.0.0.1'].includes(location.hostname) || !accounts[demoRole]) return false; - await signInWorkspace({email:accounts[demoRole], password:'Password123!'},demoRole); - return true; - } - await signInWorkspace(await response.json(),demoRole); - return true; -} - -async function choosePreviewRole(el){ - if (page !== 'login' || !Object.hasOwn(roleNames,el.dataset.previewRole)) return; - const selected = el.dataset.previewRole; - const picker = el.closest('.preview-role-picker'); - picker.disabled = true; - try { - if (!(await signInDemoWorkspace(selected))) throw new Error('Sign in with your university account.'); - role = selected; - startPreview(returnAfterSignIn); - } catch (error) { - toast(error.message, "error"); - } finally { - picker.disabled = false; - } -} function toast(text, tone = 'success', options) { document.querySelector('portal-action-feedback').show(tone, text, options); } @@ -1629,9 +1579,6 @@ function action(name,el){ return; } switch(name){ - case 'preview-sign-in': - void choosePreviewRole(el); - break; case 'sign-out': document.querySelector('portal-action-feedback').clear(); { diff --git a/apps/web/public/portal-studio/desk-lamp.js b/apps/web/public/portal-studio/desk-lamp.js index b0f3172..62c7130 100644 --- a/apps/web/public/portal-studio/desk-lamp.js +++ b/apps/web/public/portal-studio/desk-lamp.js @@ -202,7 +202,7 @@ window.mountPortalControlInk = function (shadow, { coordinator = false } = {}) { const bounds = dialog?.getBoundingClientRect(); const left = bounds ? bounds.left + dialog.clientLeft - dialog.scrollLeft : 0; const top = bounds ? bounds.top + dialog.clientTop - dialog.scrollTop : 0; - const padding = target.matches('.preview-role-button') ? 1 : 3; + const padding = 3; layer.style.left = `${rect.left - left - padding}px`; layer.style.top = `${rect.top - top - padding}px`; layer.style.width = `${rect.width + padding * 2}px`; diff --git a/apps/web/public/portal-studio/login-art.css b/apps/web/public/portal-studio/login-art.css index 60e1a4c..025636d 100644 --- a/apps/web/public/portal-studio/login-art.css +++ b/apps/web/public/portal-studio/login-art.css @@ -123,28 +123,6 @@ .signin-actions .auth-recovery {justify-self:center;padding-inline:4px;font-size:13px;color:var(--muted)} .auth-feedback {margin:0;color:var(--muted);font-size:13px;line-height:1.5} .auth-feedback.error {color:var(--danger, #b14b3c)} -.preview-role-picker { - min-inline-size: 0; - margin: 22px 0 0; - padding: 10px 0 0; - border: 0; - border-top: 1px solid var(--line); -} -.preview-role-picker legend { padding: 0 10px 0 0; color: var(--muted); font-size: 13px; } -.preview-role-options { display: flex; flex-wrap: wrap; gap: 8px; } -.preview-role-button { - min-height: 40px; - padding: 7px 11px; - border: 1px solid var(--control); - border-radius: 7px; - background: var(--raised); - color: var(--ink); - font: inherit; - font-size: 13px; - cursor: pointer; -} -.preview-role-button:hover { background: var(--ink); color: var(--canvas); } -.preview-role-button:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; } @media(max-width:760px){.auth:has(> .signin-print) .signin-print img{width:min(100%,38vh,400px)}} .portal-studio .auth:has(> .signin-print) .signin-copy { @@ -226,7 +204,6 @@ body > .portal-focus-ring[data-service-ink] {z-index:4} @media (forced-colors:none) { [data-portal-focus]:focus-visible {outline:none!important} - .preview-role-button[data-portal-focus]:focus-visible {border-color:transparent} } @media (prefers-reduced-motion:no-preference) { .portal-focus-ring path { diff --git a/apps/web/vite.config.js b/apps/web/vite.config.js index 9e2300d..88a7937 100644 --- a/apps/web/vite.config.js +++ b/apps/web/vite.config.js @@ -4,70 +4,6 @@ import { join, posix, relative, resolve } from "node:path"; import { defineConfig } from "vite"; import react from "@vitejs/plugin-react"; -const standardDemo = { - administrator: "admin@guc.edu.eg", - coordinator: "nadia.coordinator@guc.edu.eg", - advisor: "sherif.advisor@guc.edu.eg", - advisingStudent: "layla.advising@student.guc.edu.eg", - normalStudent: "karim.normal@student.guc.edu.eg", -}; -const extraHoursDemo = { - coordinator: "extra.coordinator@guc.edu.eg", - advisor: "extra.advisor@guc.edu.eg", - advisingStudent: "extra.create@student.guc.edu.eg", - wallet: "extra.wallet@student.guc.edu.eg", - gateway: "extra.gateway@student.guc.edu.eg", - defer: "extra.defer@student.guc.edu.eg", - reject: "extra.reject@student.guc.edu.eg", - withdraw: "extra.withdraw@student.guc.edu.eg", - blank: "extra.blank@student.guc.edu.eg", - probation: "extra.probation@student.guc.edu.eg", - graduate: "extra.graduate@student.guc.edu.eg", - activation: "extra.activation@student.guc.edu.eg", - retry: "extra.retry@student.guc.edu.eg", - retryManual: "extra.retrymanual@student.guc.edu.eg", - refund: "extra.refund@student.guc.edu.eg", -}; -const demoLabels = { - administrator: "Administrator", coordinator: "Coordinator", advisor: "Advisor", - normalStudent: "Normal student", advisingStudent: "Advising student", wallet: "Wallet student", - gateway: "Gateway student", defer: "Deferral student", reject: "Rejection student", - withdraw: "Withdrawal student", blank: "Blank-note student", probation: "Probation student", - graduate: "Graduation-limit student", - activation: "Course activation student", - retry: "Gateway retry student", - retryManual: "Gateway retry student (manual test)", - refund: "Refund history student", -}; - -function localPortalDemo() { - return { - name: "local-portal-demo", - configureServer(server) { - const preset = process.env.BOBOS_PORTAL_DEMO; - if (preset !== "standard" && preset !== "extra-hours") return; - server.middlewares.use("/__bobos_local_demo", (req, res) => { - if (req.method !== "GET" || !["127.0.0.1", "::1", "::ffff:127.0.0.1"].includes(req.socket.remoteAddress)) { - res.writeHead(404).end(); - return; - } - const accounts = preset === "extra-hours" ? extraHoursDemo : standardDemo; - const role = new URL(req.url, "http://localhost").searchParams.get("role"); - if (role !== null && !Object.hasOwn(accounts, role)) { - res.writeHead(404).end(); - return; - } - const password = preset === "extra-hours" ? "ExtraHoursDemo123!" : "Password123!"; - const data = role === null - ? { accounts: Object.entries(accounts).map(([key, email]) => ({ label: demoLabels[key], email, password })) } - : { email: accounts[role], password }; - res.writeHead(200, { "Content-Type": "application/json", "Cache-Control": "no-store" }) - .end(JSON.stringify(data)); - }); - }, - }; -} - // Keep compatibility entry files and one actual Portal document in the build. const portalPage = "portal-studio/index.html"; const htmlEntries = ["index.html", "workspace.html", "academic-services.html", portalPage]; @@ -118,7 +54,7 @@ function portalSite() { } export default defineConfig(({ command, isPreview }) => ({ - plugins: [react(), localPortalDemo(), portalSite()], + plugins: [react(), portalSite()], // Concurrent dev servers must keep their optimized dependencies separate. ...(command === "serve" && !isPreview && { cacheDir: `node_modules/.vite/dev-${process.pid}` }), build: { rollupOptions: { diff --git a/docs/group-a-sprint2-audit.md b/docs/group-a-sprint2-audit.md index 1878e1d..54ee595 100644 --- a/docs/group-a-sprint2-audit.md +++ b/docs/group-a-sprint2-audit.md @@ -44,7 +44,7 @@ Probation emails are tested through a local SMTP test server, not a real GUC mai ### Manual extra-hours fixtures -Run `node scripts/seed-extra-hours-demo.mjs` from the repository root with `EXTRA_HOURS_DEMO_URI` set to the URI of a local MongoDB replica set database named `extra_hours_manual`. Run the API against that same database, and set `BOBOS_PORTAL_DEMO=extra-hours` when starting Vite to use its demo advisor and coordinator. The seed adds missing fixtures and preserves existing request and payment history. Use a new temporary replica set when you need a fresh run. +Run `node scripts/seed-extra-hours-demo.mjs` from the repository root with `EXTRA_HOURS_DEMO_URI` set to the URI of a local MongoDB replica set database named `extra_hours_manual`. Run the API against that same database, then sign in with the seeded advisor or coordinator credentials. The seed adds missing fixtures and preserves existing request and payment history. Use a new temporary replica set when you need a fresh run. The demo uses term **EHTEST**, courses **EHT101**, **EHT202**, **EHT301**, and **EHT404**, and the password `ExtraHoursDemo123!`. The coordinator and advisor sign in with `extra.coordinator@guc.edu.eg` and `extra.advisor@guc.edu.eg`. The student accounts use `extra.@student.guc.edu.eg`. The local demo picker includes accounts for wallet, gateway, deferral, retries, course activation, and refund history. The seed creates the starting requests. Complete the local settlement workflow to populate the history for each scenario. diff --git a/docs/portal-design-system.md b/docs/portal-design-system.md index 0abd1eb..7792ea3 100644 --- a/docs/portal-design-system.md +++ b/docs/portal-design-system.md @@ -36,7 +36,7 @@ From the repository root run `npm run dev` and open `http://localhost:5173/`. Th The paths below refer to `apps/web/public/portal-studio/`. It is the runnable visual reference. The React application lives under `apps/web/src/`. When bringing artwork to a real workflow, keep its existing data, access controls, loading states and submission behavior. -For local tests with seeded accounts, start Vite with `BOBOS_PORTAL_DEMO=standard` for the standard seed or `BOBOS_PORTAL_DEMO=extra-hours` for the extra-hours sandbox. Quick demo sign-in authenticates through the API. When initializing a new local database with the base seed, also set `BOBOS_PORTAL_DEMO=standard` on the seed command to enable the preview administrator account. Graduation plans, Extra-hours requests, and Academic services render their existing React components inside Portal’s main content and share its session and theme. The former Workspace and Academic Services HTML URLs redirect to Portal and preserve the requested service. Home and the Portal wordmark return to the illustrated dashboard for the signed-in role. +For local tests, enter the seeded email and password on the sign-in screen. When initializing a new local database with the base seed, set `BOBOS_PORTAL_DEMO=standard` on the seed command to enable the preview administrator account. Graduation plans, Extra-hours requests, and Academic services render their existing React components inside Portal’s main content and share its session and theme. The former Workspace and Academic Services HTML URLs redirect to Portal and preserve the requested service. Home and the Portal wordmark return to the illustrated dashboard for the signed-in role. Academic services keeps the illustrated portal sidebar and theme. Academic services use Portal navigation without an additional page-selector dropdown. Advising students, Financial records, Course removals, Group assignments, Schedule preferences and Slot change requests open their live React services. Slot change requests appears in Scheduling for advisors and coordinators and Support for advising students. Signed-in advisors can start a plan from either Advising students or Graduation plans and track submissions in My submitted plans. Coordinators use Graduation review, and advising students use My graduation under Support. Signed-in students open Calendar sync from Support. Calendar sync labels the OAuth action “Sync with Google Calendar”. On localhost, an expired student demo session is renewed once before retrying the calendar request; Google consent still selects the calendar account. My advisor uses the illustrated contact layout and office drawing. The sidebar, refreshes, and older advisor-assignment bookmarks all open the same page. Keep the current advisor's name and email, loading, unassigned, and error states within that layout. Existing Portal screens should have one renderer per workflow. Connect live data inside the approved screen, and route older bookmarks to that renderer. When changing this route, run the browser test that checks the illustration, real contact data, and older links. @@ -118,7 +118,7 @@ When an action shows its line boil, the active SVG path draws both the button fa Profiles use a sage campus ID with the same initials as the directory. On a student record, Academic details, Advisor history and Schedule workflow expand independently so the reader can consult multiple sections. Student actions carry the selected student through to their schedule and preferences. ## Google Calendar connection -Calendar sync renders directly within Portal Studio and reads the authenticated API connection, Google account email, synchronization time and errors. OAuth callbacks return to the same illustrated portal page. Existing workspace calendar bookmarks redirect into this page. Local student demo connection actions authenticate through the API before opening Google authorization. Other deployments use the portal student sign-in flow. +Calendar sync renders directly within Portal Studio and reads the authenticated API connection, Google account email, synchronization time and errors. OAuth callbacks return to the same illustrated portal page. Existing workspace calendar bookmarks redirect into this page. Students with a missing or expired session sign in through the portal before connecting a Google account. In local development, OAuth returns to the loopback origin that started the connection, preserving the browser's Portal session. The Google callback URI stays configured separately. Production returns to the configured Portal origin. @@ -217,7 +217,7 @@ Student directory sorts names alphabetically and opens advisor roster management For populated local coordinator requests, use `npm run seed:coordinator-workspace --workspace @bobos/api` with `MONGODB_URI` pointed to the running local replica set and the standard Portal/evaluation curriculum present. The seed adds reviewable extra-hours requests, a settled payment and a slot-change request with an available replacement. It updates numbered demo identities only when both the fixture email and placeholder name match. Running it again preserves existing decisions and records. -With the local coordinator seed loaded, open the [submitted preferences preview](http://localhost:5173/portal-studio/index.html?page=preferences&role=coordinator&preview=live&student=79-32001&term=S2026). Choose Coordinator at quick demo sign-in if prompted. The link selects the student and term using the regular staff lookup. +With the local coordinator seed loaded, open the [submitted preferences preview](http://localhost:5173/portal-studio/index.html?page=preferences&role=coordinator&preview=live&student=79-32001&term=S2026). Sign in with the seeded coordinator account if prompted. The link selects the student and term using the regular staff lookup. Advisor Home leads with the assigned schedule review and calendar, followed by links to the advisor’s request queues. The schedule folders and calendar keep their existing motion and open the same live records. diff --git a/docs/production-readiness.md b/docs/production-readiness.md index 4902c98..9a99dcf 100644 --- a/docs/production-readiness.md +++ b/docs/production-readiness.md @@ -10,6 +10,6 @@ Complete these items when preparing the production release or assessment deploym ## Presentation and payments -- Keep Quick demo sign-in and fixture-only controls limited to localhost. Audit every role for visible “demo only”, “test only”, developer copy, placeholder content and controls that disclose simulation mechanics. +- Verify the sign-in screen requires university credentials on every host. Audit every role for visible “demo only”, “test only”, developer copy, placeholder content and controls that disclose simulation mechanics. - Keep the sandbox payment gateway required by requirement 91. Present the normal **Pay** and payment status labels. Remove phrases such as “fake Stripe payment” from the customer-facing interface. Require a successful sandbox response before recording a payment or applying approved courses and hours. Never store card numbers, CVVs or gateway passwords. - Verify standard sign-in, sign-out, disabled-account handling and email OTP reset for every role. The requirements workbook’s items 1 and 2 cover normal login and OTP reset. Neither the workbook nor the assignment brief requires a 15-minute login lockout. diff --git a/tests/browser/portal.spec.mjs b/tests/browser/portal.spec.mjs index 162b9a8..9dd85bf 100644 --- a/tests/browser/portal.spec.mjs +++ b/tests/browser/portal.spec.mjs @@ -118,6 +118,9 @@ test("Sidebar keeps lower navigation links in place across page changes and hist test("Req 1–5: reset through email, view your profile and inbox, and sign out", async ({ page }) => { await page.goto(baseURL); + await expect(page.getByLabel("University email")).toBeVisible(); + await expect(page.getByRole("group", { name: /quick demo sign-in/i })).toHaveCount(0); + await expect(page.getByRole("button", { name: /^(Coordinator|Administrator|Advisor|Advising student|Normal student)$/i })).toHaveCount(0); await page.getByRole("link", { name: /forgot password/i }).click(); await page.getByLabel("University email").fill(email); await page.getByRole("button", { name: /send reset code/i }).click();