Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions packages/e2e/tests/app-dev-server.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import {appScaffoldFixture as test} from '../fixtures/app-scaffold.js'
import {requireEnv} from '../fixtures/env.js'
import {expect} from '@playwright/test'

test.describe('App dev server @phase2', () => {
test('dev starts, shows ready message, and quits with q', async ({appScaffold, cli, env}) => {
requireEnv(env, 'partnersToken', 'clientId', 'storeFqdn')

// Step 1: Create an app
const initResult = await appScaffold.init({
template: 'reactRouter',
flavor: 'javascript',
packageManager: 'npm',
})
expect(initResult.exitCode).toBe(0)

// Step 2: Start dev server via PTY
// Unset CI so keyboard shortcuts are enabled in the Dev UI
const dev = await cli.spawn(
[
'app', 'dev',
'--path', appScaffold.appDir,
],
{env: {CI: ''}},
)

// Step 3: Wait for the ready message
await dev.waitForOutput('Ready, watching for changes in your app', 3 * 60 * 1000)

// Step 4: Verify keyboard shortcuts are shown (indicates TTY mode is working)
const output = dev.getOutput()
expect(output).toContain('q')

// Step 5: Press q to quit
dev.sendKey('q')

// Step 6: Wait for clean exit
const exitCode = await dev.waitForExit(30_000)
expect(exitCode).toBe(0)
})
})
Loading