Repository Public
1import { expect, test } from '@playwright/test';2import { waitTermOpen, watch } from './helpers';3import { DEMO_OUTPUT, setTheme, shot } from './shot-helpers';4import { expectNoClaude, seedCodex, token } from './codex-helpers';56/** Phone (iPhone 15 WebKit emulation) on the Codex instance: wording, accent and the screenshot set. */7test('codex phone: home in light, terminal, home in dark', async ({ page }) => {8 const w = watch(page);9 await setTheme(page, 'light');10 const ids = await seedCodex(page);1112 await page.goto('/home/');13 await expect(page.getByTestId('needs-you')).toBeVisible();14 await expect(page.getByTestId('task-activity')).toBeVisible();15 await expect(page.getByTestId('host-strip')).toContainText('as of');16 await expect(page.locator('html')).toHaveAttribute('data-agent', 'codex');17 await expect(page).toHaveTitle('Codex Remote');18 await expect(page.getByTestId('home-new-session')).toHaveText('New Codex session');19 await expect(page.getByTestId('home')).toContainText('Codex Remote');20 await expect(page.getByTestId('home')).toContainText('Codex · demo');21 expect(await token(page, '--color-accent')).toBe('#0b7268');22 // the header gradient and the pill ink are the emerald family23 expect(await page.getByTestId('home-new-session').evaluate((el) => getComputedStyle(el).color)).toBe('rgb(10, 107, 96)');24 expect(await page.locator('header.bg-brand').evaluate((el) => getComputedStyle(el).backgroundImage)).toContain('rgb(4, 120, 87)');25 await page.waitForTimeout(900);26 await expectNoClaude(page, 'phone home');27 await shot(page, 'codex-light-phone-home');2829 await page.goto(`/terminal/?s=${ids.shell}`);30 await waitTermOpen(page, ids.shell);31 await page.getByTestId('terminal').tap();32 await page.keyboard.type(DEMO_OUTPUT);33 await page.waitForTimeout(700);34 await expectNoClaude(page, 'phone terminal');35 await shot(page, 'codex-light-phone-terminal');3637 await page.evaluate(() => localStorage.setItem('cr.theme', 'dark'));38 await page.addInitScript(() => localStorage.setItem('cr.theme', 'dark'));39 await page.goto('/home/');40 await expect(page.getByTestId('needs-you')).toBeVisible();41 await expect(page.getByTestId('task-activity')).toBeVisible();42 await expect(page.locator('html')).toHaveAttribute('data-theme', 'dark');43 expect(await token(page, '--color-accent')).toBe('#2dd4bf');44 await page.waitForTimeout(900);45 await shot(page, 'codex-dark-phone-home');46 w.expectClean();47});48