Skip to content

Commit eaad57b

Browse files
committed
polish
1 parent 9a1893f commit eaad57b

5 files changed

Lines changed: 21 additions & 16 deletions

File tree

packages/e2e/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,7 @@
3030
},
3131
"devDependencies": {
3232
"@playwright/test": "^1.50.0",
33-
"@shopify/cli-kit": "3.92.0",
34-
"@types/node": "18.19.70",
33+
"@types/node": "18.19.70",
3534
"execa": "^7.2.0",
3635
"node-pty": "^1.0.0",
3736
"strip-ansi": "^7.1.0",

packages/e2e/setup/app.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,10 +78,6 @@ export const appScaffoldFixture = authFixture.extend<{appScaffold: AppScaffold}>
7878
timeout: 5 * 60 * 1000,
7979
})
8080

81-
if (result.exitCode !== 0) {
82-
return result
83-
}
84-
8581
const allOutput = `${result.stdout}\n${result.stderr}`
8682
const match = allOutput.match(/([\w-]+) is ready for you to build!/)
8783

packages/e2e/setup/cli.ts

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,15 @@ export const cliFixture = envFixture.extend<{cli: CLIProcess}>({
4949
async exec(args, opts = {}) {
5050
// 3 min default
5151
const timeout = opts.timeout ?? 3 * 60 * 1000
52+
const execEnv: {[key: string]: string} = {}
53+
for (const [key, value] of Object.entries({...env.processEnv, ...opts.env})) {
54+
if (value !== undefined) {
55+
execEnv[key] = value
56+
}
57+
}
5258
const execaOpts: ExecaOptions = {
5359
cwd: opts.cwd,
54-
env: {...env.processEnv, ...opts.env},
60+
env: execEnv,
5561
extendEnv: false,
5662
timeout,
5763
reject: false,
@@ -73,9 +79,15 @@ export const cliFixture = envFixture.extend<{cli: CLIProcess}>({
7379
async execCreateApp(args, opts = {}) {
7480
// 5 min default for scaffolding
7581
const timeout = opts.timeout ?? 5 * 60 * 1000
82+
const execEnv: {[key: string]: string} = {}
83+
for (const [key, value] of Object.entries({...env.processEnv, ...opts.env})) {
84+
if (value !== undefined) {
85+
execEnv[key] = value
86+
}
87+
}
7688
const execaOpts: ExecaOptions = {
7789
cwd: opts.cwd,
78-
env: {...env.processEnv, ...opts.env},
90+
env: execEnv,
7991
extendEnv: false,
8092
timeout,
8193
reject: false,

packages/e2e/tests/app-basic.spec.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1+
/* eslint-disable no-restricted-imports */
12
import {appScaffoldFixture as test} from '../setup/app.js'
23
import {requireEnv} from '../setup/env.js'
34
import {expect} from '@playwright/test'
4-
import {joinPath} from '@shopify/cli-kit/node/path'
55
import * as fs from 'fs'
6+
import * as path from 'path'
67

78
test.describe('App basic flow (no extensions)', () => {
89
test('init, dev, execute, quit, clean, deploy, versions, config link, deploy to secondary', async ({
@@ -38,7 +39,7 @@ test.describe('App basic flow (no extensions)', () => {
3839
)
3940
const executeOutput = executeResult.stdout + executeResult.stderr
4041
expect(executeResult.exitCode, '‼️ Step 3 - app execute failed').toBe(0)
41-
expect(executeOutput, '‼️ Step 3 - app execute: response missing "shop" field').toContain('shop')
42+
expect(executeOutput, '‼️ Step 3 - app execute: response missing "shop" field').toContain('"shop"')
4243

4344
// Step 4: Press q to quit the dev server
4445
dev.sendKey('q')
@@ -58,7 +59,7 @@ test.describe('App basic flow (no extensions)', () => {
5859
}
5960

6061
// Step 6: Deploy the primary app
61-
const versionTag = `e2e-v-${Date.now()}`
62+
const versionTag = `QA-E2E-1st-${Date.now()}`
6263
const deployResult = await cli.exec(
6364
[
6465
'app',
@@ -91,7 +92,7 @@ test.describe('App basic flow (no extensions)', () => {
9192
// that file already exists → overwrite confirmation prompt hangs.
9293
// (--config and --client-id are mutually exclusive flags, so we can't pass both directly.)
9394
fs.writeFileSync(
94-
joinPath(appScaffold.appDir, 'shopify.app.secondary.toml'),
95+
path.join(appScaffold.appDir, 'shopify.app.secondary.toml'),
9596
`client_id = "${env.secondaryClientId}"\n`,
9697
)
9798

@@ -106,7 +107,7 @@ test.describe('App basic flow (no extensions)', () => {
106107
expect(configLinkExitCode, '‼️ Step 8 - app config link failed').toBe(0)
107108

108109
// Step 9: Deploy to the secondary app using the linked config file
109-
const secondaryVersionTag = `e2e-secondary-v-${Date.now()}`
110+
const secondaryVersionTag = `QA-E2E-2nd-${Date.now()}`
110111
const secondaryDeployResult = await cli.exec(
111112
[
112113
'app',

pnpm-lock.yaml

Lines changed: 0 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)