Skip to content
Closed
Show file tree
Hide file tree
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
8 changes: 4 additions & 4 deletions packages/e2e/fixtures/cli-process.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,11 +121,11 @@ export const cliFixture = envFixture.extend<{cli: CLIProcess}>({
process.stdout.write(data)
}

// Check if any waiters are satisfied
// Check if any waiters are satisfied (check both raw and stripped output)
const stripped = stripAnsi(output)
for (let i = outputWaiters.length - 1; i >= 0; i--) {
const waiter = outputWaiters[i]!
if (stripped.includes(waiter.text)) {
if (stripped.includes(waiter.text) || output.includes(waiter.text)) {
waiter.resolve()
outputWaiters.splice(i, 1)
}
Expand All @@ -151,8 +151,8 @@ export const cliFixture = envFixture.extend<{cli: CLIProcess}>({
ptyProcess,

waitForOutput(text: string, timeoutMs = 3 * 60 * 1000) {
// Check if already in output
if (stripAnsi(output).includes(text)) {
// Check if already in output (raw or stripped)
if (stripAnsi(output).includes(text) || output.includes(text)) {
return Promise.resolve()
}

Expand Down
44 changes: 44 additions & 0 deletions packages/e2e/tests/app-deploy.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
import {appScaffoldFixture as test} from '../fixtures/app-scaffold.js'
import {requireEnv} from '../fixtures/env.js'
import {expect} from '@playwright/test'

test.describe('App deploy @phase1', () => {
test('deploy and verify version exists', async ({appScaffold, cli, env}) => {
requireEnv(env, 'partnersToken', 'clientId')

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

// Step 2: Deploy with a tagged version
const versionTag = `e2e-v-${Date.now()}`
const deployResult = await cli.exec(
[
'app', 'deploy',
'--path', appScaffold.appDir,
'--force',
'--version', versionTag,
'--message', 'E2E test deployment',
],
{timeout: 5 * 60 * 1000},
)
const deployOutput = deployResult.stdout + deployResult.stderr
expect(deployResult.exitCode, `deploy failed:\n${deployOutput}`).toBe(0)

// Step 3: Verify the version exists via versions list
const listResult = await cli.exec(
['app', 'versions', 'list', '--path', appScaffold.appDir, '--json'],
{timeout: 60 * 1000},
)
const listOutput = listResult.stdout + listResult.stderr
expect(listResult.exitCode, `versions list failed:\n${listOutput}`).toBe(0)

// Check that our version tag appears in the output
const allOutput = listResult.stdout + listResult.stderr
expect(allOutput).toContain(versionTag)
})
})
Loading