@@ -251,7 +251,9 @@ export const registerBuildTest = (
251251
252252 describeCommand ( name , ( ) => {
253253 let triggerAssetsBuilt
254+ let triggerBuildComplete
254255 const assetsBuilt = new Promise ( res => ( triggerAssetsBuilt = res ) )
256+ const buildComplete = new Promise ( res => ( triggerBuildComplete = res ) )
255257
256258 const skipPackageStep = isMobile
257259
@@ -282,6 +284,9 @@ export const registerBuildTest = (
282284
283285 const _output = await build ( projectBase , opts , hooks )
284286 Object . assign ( output , _output )
287+
288+ // Store build metadata for later use
289+ triggerBuildComplete ( _output )
285290 } , buildWaitTime )
286291
287292 // Cleanup build outputs
@@ -295,18 +300,22 @@ export const registerBuildTest = (
295300 // Add ASAR integrity verification for Electron builds
296301 if ( isElectron ) {
297302 test ( 'ASAR integrity is properly configured' , async ( ) => {
298- const baseDir = ( await assetsBuilt ) as string
303+ // Use the artifact directory (final output), not the web directory (temp build)
304+ const builtOutput = ( await buildComplete ) as any
305+ const { metadata = { } } = builtOutput
306+ const artifactDir = metadata ?. artifact || ( await assetsBuilt )
299307
300308 // Find the built .app or .exe
301309 const { name } = config
302310 let appPath : string | null = null
303311
304312 if ( process . platform === 'darwin' ) {
305- // macOS - look for .app bundle
306- appPath = join ( baseDir , `${ name } .app` )
313+ // macOS - look for .app bundle in mac-arm64 or mac-x64 subdirectory
314+ const macDir = join ( artifactDir , 'mac-arm64' )
315+ appPath = join ( macDir , `${ name } .app` )
307316 } else if ( process . platform === 'win32' ) {
308317 // Windows - look for .exe
309- appPath = join ( baseDir , `${ name } .exe` )
318+ appPath = join ( artifactDir , `${ name } .exe` )
310319 }
311320
312321 if ( ! appPath ) {
0 commit comments