import { test, expect } from '@playwright/test'; const retiredRoutes = [ '/signin', '/account', '/account-deleted', '/subscription-check', '/post-auth-redirect', '/mac-app-success', ]; test.describe('Free app website', () => { test('browsing the site never starts account or billing requests', async ({ page }) => { const retiredRequests: string[] = []; page.on('request', (request) => { if (/supabase|stripe|\/api\/(?:users|subscription|auth)/i.test(request.url())) { retiredRequests.push(request.url()); } }); for (const route of ['/', '/download', '/support', '/privacy', '/tos']) { await page.goto(route); await expect(page.getByRole('heading').first()).toBeVisible(); await expect(page.locator('body')).toContainText(/free and open source|completely free\. open source/i); if (route !== '/download') { await expect(page.locator('body')).toContainText(/no subscriptions/i); await expect(page.locator('body')).toContainText(/no in-app purchases/i); } await expect(page.locator('a[href*="signin"], a[href*="account"], a[href*="subscription"], a[href*="stripe"], a[href*="buymeacoffee"], a[href="/tips"]')).toHaveCount(0); await expect(page.locator('body')).not.toContainText(/buy me a coffee|leave a tip|\$9\.99|paid support/i); await expect(page.getByRole('button', { name: /get essential|get unlimited|sign in/i })).toHaveCount(0); await expect(page.locator('body')).not.toContainText(/upgrade when|billed monthly|billing cycle|subscription-based|Deepgram|OpenAI|Supabase|Stripe|YouTube|web(?:site)?(?: page)? imports|imports from the web|importing content from the web/i); } expect(retiredRequests).toEqual([]); }); test('FAQ explains open source, no purchases and locked-device transcription', async ({ page }) => { await page.goto('/'); await page.getByRole('button', { name: 'Is Jotley free?' }).click(); await expect(page.locator('.faq-item.open')).toContainText('completely free'); await expect(page.locator('.faq-item.open')).toContainText('No subscriptions, no in-app purchases, no paid upgrades'); await expect(page.locator('.faq-item.open')).toContainText('No strings attached.'); await page.getByRole('button', { name: 'Does Jotley keep transcribing when my iPhone is locked?' }).click(); await expect(page.locator('.faq-item.open')).toContainText('keeps transcribing when your device is locked'); await expect(page.locator('.faq-item.open')).toContainText('Private iCloud sync is on by default'); }); test('MIT terms allow using and modifying the app', async ({ page }) => { await page.goto('/tos'); await expect(page.getByRole('heading', { name: '9. Source License', exact: true })).toBeVisible(); await expect(page.locator('body')).toContainText('MIT license'); await expect(page.locator('body')).not.toContainText(/reverse-engineer or decompile|No rights are granted except/); }); test('Mac installer is available through an explicit download button', async ({ page, request }) => { const manifestResponse = await request.get('/mac-release.json'); expect(manifestResponse.ok()).toBeTruthy(); const manifest = await manifestResponse.json(); await page.goto('/download'); const download = page.waitForEvent('download'); await page.getByRole('link', { name: 'Download Jotley for Mac', exact: true }).click(); expect((await download).suggestedFilename()).toBe(manifest.file); await expect(page.getByRole('link', { name: 'Download Jotley for Mac', exact: true })).toHaveAttribute('href', `/${manifest.file}`); await expect(page).toHaveURL(/\/download$/); }); for (const route of retiredRoutes) { test(`retired route ${route} returns 404`, async ({ page }) => { const response = await page.goto(route); expect(response?.status()).toBe(404); }); } test('retired installers are no longer served', async ({ request }) => { for (const path of ['/Jotley-1.0.38-b314.dmg', '/Jotley314-313.delta']) { const response = await request.get(path); expect(response.status()).toBe(404); } }); test('sitemap contains only public site pages', async ({ request }) => { const response = await request.get('/sitemap.xml'); expect(response.ok()).toBeTruthy(); const sitemap = await response.text(); for (const route of retiredRoutes) expect(sitemap).not.toContain(route); expect(sitemap).toContain('https://jotley.ai/support'); expect(sitemap).not.toContain('https://jotley.ai/tips'); }); });