Files
cs249r_book/tinytorch/quarto/community/tests/e2e/lifecycle.spec.js
Vijay Janapa Reddi edbea966bf refactor(tinytorch): rename site-quarto/ to quarto/
Brings the TinyTorch lab guide's Quarto project in line with
book/quarto/, the only other in-tree Quarto publication that builds
both web and PDF outputs from a single source. The previous name had
three redundancies:

  - already under tinytorch/, so "site-" prefix wasn't disambiguating
  - also produces the PDF lab guide, so "site-" was misleading
  - the top-level site/ dir made "site-quarto" read as "the site's
    quarto config" rather than "the tinytorch site, in quarto"

After this rename the convention is straightforward:

  book/quarto/        -> the textbook (web + PDF)
  tinytorch/quarto/   -> the TinyTorch lab guide (web + PDF)
  mlsysim/docs/       -> mlsysim API reference (kept as docs/, since it
                        really is API reference, not a publication)

Touches 7 GitHub workflows, both .gitignore files, the rename target's
own self-references (Makefile, _quarto.yml configs, STYLE.md,
measure-pdf-images.py), and 6 copies of subscribe-modal.js plus a few
shared scripts/configs whose comments documented the old path.

Verified: rebuilt pdf/TinyTorch-Guide.pdf (2.1M) cleanly from the new
location with 'make pdf' from tinytorch/quarto/.
2026-04-22 14:38:18 -04:00

49 lines
1.5 KiB
JavaScript

const { test, expect } = require('@playwright/test');
const { testUser } = require('./credentials.json');
test.describe('User Account Lifecycle', () => {
test('Login and Navigate Profile', async ({ page }) => {
// 1. Navigate to login
await page.goto('index.html?action=login');
// Ensure we are in login mode
const title = page.locator('#authTitle');
if ((await title.innerText()) === 'Create Account') {
await page.click('#authToggle');
}
// 2. Perform Login
await page.fill('#authEmail', testUser.email);
await page.fill('#authPassword', testUser.password);
// We expect a redirect after login (to dashboard or profile_setup)
await Promise.all([
page.waitForURL(/dashboard\.html|profile_setup\.html/),
page.click('#authSubmit')
]);
console.log('✅ Logged in successfully');
// 3. Verify we can open the profile modal
// Note: If redirect went to profile_setup.html, authBtn might already be active
await page.click('#authBtn');
const profileOverlay = page.locator('#profileOverlay');
await expect(profileOverlay).toHaveClass(/active/);
// 4. Check if the display name is loaded correctly
const displayNameInput = page.locator('#profileDisplayName');
await expect(displayNameInput).not.toHaveValue('');
console.log('✅ Profile data loaded correctly');
// 5. Navigate to Dashboard
await page.goto('dashboard.html');
await expect(page).toHaveURL(/dashboard\.html/);
console.log('✅ Navigation verified');
});
});