@@ -41,10 +41,8 @@ export const defaultTimeout = 30000;
4141
4242export class FullConfigInternal {
4343 readonly config : FullConfig ;
44- readonly globalOutputDir : string ;
4544 readonly configDir : string ;
4645 readonly configCLIOverrides : ConfigCLIOverrides ;
47- readonly preserveOutputDir : boolean ;
4846 readonly webServers : NonNullable < FullConfig [ 'webServer' ] > [ ] ;
4947 readonly plugins : TestRunnerPluginRegistration [ ] ;
5048 readonly projects : FullProjectInternal [ ] = [ ] ;
@@ -63,13 +61,10 @@ export class FullConfigInternal {
6361
6462 const { resolvedConfigFile, configDir } = location ;
6563 const packageJsonPath = getPackageJsonPath ( configDir ) ;
66- const packageJsonDir = packageJsonPath ? path . dirname ( packageJsonPath ) : undefined ;
67- const throwawayArtifactsPath = packageJsonDir || process . cwd ( ) ;
64+ const packageJsonDir = packageJsonPath ? path . dirname ( packageJsonPath ) : process . cwd ( ) ;
6865
6966 this . configDir = configDir ;
7067 this . configCLIOverrides = configCLIOverrides ;
71- this . globalOutputDir = takeFirst ( configCLIOverrides . outputDir , pathResolve ( configDir , userConfig . outputDir ) , throwawayArtifactsPath , path . resolve ( process . cwd ( ) ) ) ;
72- this . preserveOutputDir = configCLIOverrides . preserveOutputDir || false ;
7368 const privateConfiguration = ( userConfig as any ) [ '@playwright/test' ] ;
7469 this . plugins = ( privateConfiguration ?. plugins || [ ] ) . map ( ( p : any ) => ( { factory : p } ) ) ;
7570
@@ -128,7 +123,7 @@ export class FullConfigInternal {
128123 }
129124
130125 const projectConfigs = configCLIOverrides . projects || userConfig . projects || [ userConfig ] ;
131- this . projects = projectConfigs . map ( p => new FullProjectInternal ( configDir , userConfig , this , p , this . configCLIOverrides , throwawayArtifactsPath ) ) ;
126+ this . projects = projectConfigs . map ( p => new FullProjectInternal ( configDir , userConfig , this , p , this . configCLIOverrides , packageJsonDir ) ) ;
132127 resolveProjectDependencies ( this . projects ) ;
133128 this . _assignUniqueProjectIds ( this . projects ) ;
134129 setTransformConfig ( {
@@ -167,7 +162,7 @@ export class FullProjectInternal {
167162 deps : FullProjectInternal [ ] = [ ] ;
168163 teardown : FullProjectInternal | undefined ;
169164
170- constructor ( configDir : string , config : Config , fullConfig : FullConfigInternal , projectConfig : Project , configCLIOverrides : ConfigCLIOverrides , throwawayArtifactsPath : string ) {
165+ constructor ( configDir : string , config : Config , fullConfig : FullConfigInternal , projectConfig : Project , configCLIOverrides : ConfigCLIOverrides , packageJsonDir : string ) {
171166 this . fullConfig = fullConfig ;
172167 const testDir = takeFirst ( pathResolve ( configDir , projectConfig . testDir ) , pathResolve ( configDir , config . testDir ) , fullConfig . configDir ) ;
173168 const defaultSnapshotPathTemplate = '{snapshotDir}/{testFileDir}/{testFileName}-snapshots/{arg}{-projectName}{-snapshotSuffix}{ext}' ;
@@ -176,7 +171,7 @@ export class FullProjectInternal {
176171 this . project = {
177172 grep : takeFirst ( projectConfig . grep , config . grep , defaultGrep ) ,
178173 grepInvert : takeFirst ( projectConfig . grepInvert , config . grepInvert , null ) ,
179- outputDir : takeFirst ( configCLIOverrides . outputDir , pathResolve ( configDir , projectConfig . outputDir ) , pathResolve ( configDir , config . outputDir ) , path . join ( throwawayArtifactsPath , 'test-results' ) ) ,
174+ outputDir : takeFirst ( configCLIOverrides . outputDir , pathResolve ( configDir , projectConfig . outputDir ) , pathResolve ( configDir , config . outputDir ) , path . join ( packageJsonDir , 'test-results' ) ) ,
180175 // Note: we either apply the cli override for repeatEach or not, depending on whether the
181176 // project is top-level vs dependency. See collectProjectsAndTestFiles in loadUtils.
182177 repeatEach : takeFirst ( projectConfig . repeatEach , config . repeatEach , 1 ) ,
0 commit comments